2016-04-20 21:07:18 +00:00
|
|
|
#ifndef __URDE_CSCRIPTDOCK_HPP__
|
|
|
|
#define __URDE_CSCRIPTDOCK_HPP__
|
|
|
|
|
|
|
|
#include "CPhysicsActor.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
|
|
|
class CScriptDock : public CPhysicsActor
|
|
|
|
{
|
2017-01-04 04:08:30 +00:00
|
|
|
enum EDockState
|
|
|
|
{
|
2017-01-04 06:39:56 +00:00
|
|
|
Idle,
|
2017-01-04 04:08:30 +00:00
|
|
|
PlayerTouched,
|
2017-01-04 06:39:56 +00:00
|
|
|
EnterNextArea,
|
2017-01-04 04:08:30 +00:00
|
|
|
Three
|
|
|
|
};
|
|
|
|
|
2016-04-23 00:29:55 +00:00
|
|
|
friend class CScriptDoor;
|
2017-01-04 04:08:30 +00:00
|
|
|
s32 x258_dockReferenceCount;
|
2016-04-20 21:07:18 +00:00
|
|
|
s32 x25c_dock;
|
|
|
|
TAreaId x260_area;
|
2017-01-04 04:08:30 +00:00
|
|
|
EDockState x264_dockState = EDockState::Three;
|
|
|
|
union {
|
2016-04-20 21:07:18 +00:00
|
|
|
struct
|
|
|
|
{
|
2017-01-04 04:08:30 +00:00
|
|
|
bool x268_24_dockReferenced : 1;
|
|
|
|
bool x268_25_loadConnected : 1;
|
|
|
|
bool x268_26_areaPostConstructed : 1;
|
2016-04-20 21:07:18 +00:00
|
|
|
};
|
|
|
|
u8 dummy = 0;
|
|
|
|
};
|
2017-01-04 04:08:30 +00:00
|
|
|
|
2016-04-20 21:07:18 +00:00
|
|
|
public:
|
2017-11-13 06:19:18 +00:00
|
|
|
CScriptDock(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CVector3f position,
|
2017-11-12 05:14:57 +00:00
|
|
|
const zeus::CVector3f& extent, s32 dock, TAreaId area, bool active,
|
|
|
|
s32 dockReferenceCount, bool loadConnected);
|
2016-04-24 02:46:13 +00:00
|
|
|
|
2017-01-15 03:07:01 +00:00
|
|
|
void Accept(IVisitor& visitor);
|
2017-01-04 04:08:30 +00:00
|
|
|
void Think(float, CStateManager&);
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
|
2018-04-30 03:12:41 +00:00
|
|
|
std::experimental::optional<zeus::CAABox> GetTouchBounds() const;
|
2017-01-04 04:08:30 +00:00
|
|
|
void Touch(CActor&, CStateManager&);
|
|
|
|
void CleanUp() {}
|
|
|
|
zeus::CPlane GetPlane(const CStateManager&) const;
|
|
|
|
TAreaId GetDestinationAreaId() const { return x260_area; }
|
2016-04-24 02:46:13 +00:00
|
|
|
s32 GetDockId() const { return x25c_dock; }
|
2017-01-04 04:08:30 +00:00
|
|
|
void SetDockReference(CStateManager& mgr, s32);
|
2018-04-30 03:12:41 +00:00
|
|
|
s32 GetDockReference(const CStateManager& mgr) const;
|
2016-12-22 02:48:22 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // __URDE_CSCRIPTDOCK_HPP__
|