2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CENTITY
|
|
|
|
#define _CENTITY
|
2022-08-09 23:03:51 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "MetroidPrime/CEntityInfo.hpp"
|
|
|
|
#include "MetroidPrime/CStateManager.hpp"
|
|
|
|
#include "MetroidPrime/TCastTo.hpp"
|
|
|
|
#include "MetroidPrime/TGameTypes.hpp"
|
|
|
|
|
|
|
|
#include "rstl/string.hpp"
|
|
|
|
#include "rstl/vector.hpp"
|
|
|
|
|
|
|
|
class CEntity {
|
|
|
|
public:
|
|
|
|
virtual ~CEntity();
|
|
|
|
virtual void Accept(IVisitor& visitor) = 0;
|
2022-10-09 05:37:23 +00:00
|
|
|
virtual void PreThink(float dt, CStateManager& mgr);
|
|
|
|
virtual void Think(float dt, CStateManager& mgr);
|
2022-08-11 02:33:46 +00:00
|
|
|
virtual void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr);
|
2022-10-17 15:59:36 +00:00
|
|
|
virtual void SetActive(uchar active);
|
2022-08-09 23:03:51 +00:00
|
|
|
|
|
|
|
CEntity(TUniqueId id, const CEntityInfo& info, bool active, const rstl::string& name);
|
|
|
|
|
2022-08-11 02:33:46 +00:00
|
|
|
void SendScriptMsgs(EScriptObjectState state, CStateManager& mgr, EScriptObjectMessage msg);
|
2022-09-18 06:05:46 +00:00
|
|
|
static inline void SendScriptMsg(CStateManager& mgr, CEntity* to, TUniqueId sender,
|
|
|
|
EScriptObjectMessage msg) {
|
2022-09-18 05:55:13 +00:00
|
|
|
mgr.SendScriptMsg(to, sender, msg);
|
|
|
|
}
|
2022-08-11 02:33:46 +00:00
|
|
|
TUniqueId GetUniqueId() const { return x8_uid; }
|
2022-10-02 10:13:35 +00:00
|
|
|
TEditorId GetEditorId() const { return xc_editorId; }
|
2022-10-22 16:00:11 +00:00
|
|
|
const rstl::string& GetDebugName() const { return x10_name; }
|
2022-08-11 02:33:46 +00:00
|
|
|
TAreaId GetAreaId() const;
|
2022-10-22 15:56:07 +00:00
|
|
|
TAreaId GetCurrentAreaId() const { return x4_areaId; }
|
2022-09-14 05:24:12 +00:00
|
|
|
bool GetActive() const { return x30_24_active; }
|
2022-10-14 04:50:56 +00:00
|
|
|
bool IsScriptingBlocked() const { return x30_26_scriptingBlocked; }
|
2022-09-19 04:19:46 +00:00
|
|
|
|
|
|
|
// might be fake?
|
|
|
|
rstl::vector< SConnection >& ConnectionList() { return x20_conns; }
|
2022-09-18 05:55:13 +00:00
|
|
|
const rstl::vector< SConnection >& GetConnectionList() const { return x20_conns; }
|
2022-08-11 02:33:46 +00:00
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
static rstl::vector< SConnection > NullConnectionList;
|
2022-08-09 23:03:51 +00:00
|
|
|
|
2022-10-22 15:56:07 +00:00
|
|
|
private:
|
2022-08-09 23:03:51 +00:00
|
|
|
TAreaId x4_areaId;
|
|
|
|
TUniqueId x8_uid;
|
|
|
|
TEditorId xc_editorId;
|
|
|
|
rstl::string x10_name;
|
2022-09-18 05:55:13 +00:00
|
|
|
rstl::vector< SConnection > x20_conns;
|
2022-10-17 15:59:36 +00:00
|
|
|
uchar x30_24_active : 1;
|
2022-08-09 23:03:51 +00:00
|
|
|
bool x30_25_inGraveyard : 1;
|
|
|
|
bool x30_26_scriptingBlocked : 1;
|
2022-08-11 02:33:46 +00:00
|
|
|
bool x30_27_notInArea : 1;
|
2022-08-09 23:03:51 +00:00
|
|
|
};
|
|
|
|
|
2022-08-13 01:26:00 +00:00
|
|
|
CHECK_SIZEOF(CEntity, 0x34)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CENTITY
|