2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-20 21:07:18 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
#include "Runtime/World/CPhysicsActor.hpp"
|
2016-04-20 21:07:18 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2016-04-20 21:07:18 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CScriptDock : public CPhysicsActor {
|
2020-02-01 02:34:07 +00:00
|
|
|
enum class EDockState { Idle, PlayerTouched, EnterNextArea, Three };
|
2017-01-04 04:08:30 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
friend class CScriptDoor;
|
|
|
|
s32 x258_dockReferenceCount;
|
|
|
|
s32 x25c_dock;
|
|
|
|
TAreaId x260_area;
|
|
|
|
EDockState x264_dockState = EDockState::Three;
|
2020-04-20 04:57:50 +00:00
|
|
|
bool x268_24_dockReferenced : 1 = false;
|
2020-04-11 05:50:10 +00:00
|
|
|
bool x268_25_loadConnected : 1;
|
2020-04-20 04:57:50 +00:00
|
|
|
bool x268_26_areaPostConstructed : 1 = false;
|
2017-01-04 04:08:30 +00:00
|
|
|
|
2016-04-20 21:07:18 +00:00
|
|
|
public:
|
2021-05-26 14:00:57 +00:00
|
|
|
DEFINE_ENTITY
|
2019-09-06 14:49:51 +00:00
|
|
|
CScriptDock(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f& position,
|
2018-12-08 05:30:43 +00:00
|
|
|
const zeus::CVector3f& extent, s32 dock, TAreaId area, bool active, s32 dockReferenceCount,
|
|
|
|
bool loadConnected);
|
2016-04-24 02:46:13 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void Think(float, CStateManager&) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
|
|
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
|
|
|
void Touch(CActor&, CStateManager&) override;
|
2018-12-08 05:30:43 +00:00
|
|
|
void CleanUp() {}
|
|
|
|
zeus::CPlane GetPlane(const CStateManager&) const;
|
|
|
|
TAreaId GetAreaId() const { return x260_area; }
|
|
|
|
s32 GetDockId() const { return x25c_dock; }
|
|
|
|
void SetDockReference(CStateManager& mgr, s32);
|
|
|
|
s32 GetDockReference(const CStateManager& mgr) const;
|
|
|
|
TAreaId GetCurrentConnectedAreaId(const CStateManager&) const;
|
|
|
|
void UpdateAreaActivateFlags(CStateManager&);
|
|
|
|
bool HasPointCrossedDock(const CStateManager&, const zeus::CVector3f&) const;
|
|
|
|
void AreaLoaded(CStateManager&);
|
|
|
|
void AreaUnloaded(CStateManager&);
|
|
|
|
void SetLoadConnected(CStateManager&, bool);
|
2016-04-20 21:07:18 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|