Files
mtgodot-poc/extension/src/port/GameLib/FlyTarget.h
T
shenleiandClaude Opus 5 fc47582017 port 2A step 2: copy the 40250 header closure into the port mirror
76 closure headers (EterBase, EterLocale, EterPack, EterLib, GameLib, MilesLib,
EffectLib, SphereLib, EterImageLib) copied by the new port_copy.py (CP949->UTF-8,
LF, include-path case only); platform-class headers go to the mirror path too, as
the interface platform/ implements. Six manual `// PORT:` edits (Random, Singleton,
Pool, Stl, Utils, FlyTarget).

- common/D3D8Types.h: D3D8 value types with SDK values/layout, opaque COM interfaces
- common/shim/sdk (d3d8/d3dx8/mss) on every platform, common/shim/win32 off Windows
- Win32Types/Win32Crt: HRESULT, GUID, LARGE_INTEGER, LOGFONT/TEXTMETRIC, _atoi64,
  CRITICAL_SECTION on std::recursive_mutex
- header gate prepends each library's StdAfx.h (40250's precompiled header)

port_gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain).
ScriptLib/EterPythonLib/UserInterface wait for 2P (their StdAfx includes Python).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 20:27:57 +09:00

83 lines
1.7 KiB
C++

#pragma once
class CFlyTarget; // PORT: MSVC makes the friend declaration below visible; ISO C++ needs this
class IFlyTargetableObject
{
friend class CFlyTarget;
public:
IFlyTargetableObject() {}
virtual ~IFlyTargetableObject() {}
virtual D3DXVECTOR3 OnGetFlyTargetPosition() = 0;
virtual void OnShootDamage() = 0;
protected:
inline void ClearFlyTargeter();
private:
std::set<CFlyTarget*> m_FlyTargeterSet;
inline void AddFlyTargeter(CFlyTarget* pTargeter)
{
//if (m_FlyTargeterSet.find(pTargeter)!=m_FlyTargeterSet.end())
m_FlyTargeterSet.insert(pTargeter);
}
inline void RemoveFlyTargeter(CFlyTarget* pTargeter)
{
//if (m_FlyTargeterSet.find(pTargeter)!=m_FlyTargeterSet.end())
m_FlyTargeterSet.erase(pTargeter);
}
};
class CFlyTarget // final
{
public:
enum EType
{
TYPE_NONE,
TYPE_OBJECT,
TYPE_POSITION,
};
public:
CFlyTarget();
CFlyTarget(IFlyTargetableObject * pFlyTarget);
CFlyTarget(const D3DXVECTOR3& v3FlyTargetPosition);
CFlyTarget(const CFlyTarget& rhs);
virtual ~CFlyTarget();
void Clear();
bool IsObject();
bool IsPosition();
bool IsValidTarget();
void NotifyTargetClear();
const D3DXVECTOR3 & GetFlyTargetPosition() const;
EType GetType();
IFlyTargetableObject * GetFlyTarget();
CFlyTarget & operator = (const CFlyTarget & rhs);
void GetFlyTargetData(CFlyTarget * pFlyTarget);
private:
void __Initialize();
private:
mutable D3DXVECTOR3 m_v3FlyTargetPosition;
IFlyTargetableObject * m_pFlyTarget;
EType m_eType;
};
inline void IFlyTargetableObject::ClearFlyTargeter()
{
std::set<CFlyTarget*>::iterator it;
for(it = m_FlyTargeterSet.begin();it!=m_FlyTargeterSet.end();++it)
{
(*it)->NotifyTargetClear();
}
m_FlyTargeterSet.clear();
}