metaforce/Runtime/World/IGameArea.hpp

71 lines
1.9 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-04-18 17:17:49 -07:00
#include <memory>
#include <utility>
#include <vector>
#include "Runtime/RetroTypes.hpp"
#include "Runtime/rstl.hpp"
#include <zeus/CTransform.hpp>
#include <zeus/CVector3f.hpp>
2016-04-23 11:04:49 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
2016-07-22 17:26:17 -07:00
class CEntity;
2016-04-18 17:17:49 -07:00
2018-12-07 21:30:43 -08:00
class IGameArea {
2016-04-18 17:17:49 -07:00
public:
2018-12-07 21:30:43 -08:00
class Dock {
public:
struct SDockReference {
u32 x0_area = 0;
s16 x4_dock = 0;
bool x6_loadOther = false;
SDockReference() = default;
2016-04-18 17:17:49 -07:00
};
2016-07-22 17:26:17 -07:00
2018-12-07 21:30:43 -08:00
private:
s32 x0_referenceCount = 0;
2018-12-07 21:30:43 -08:00
std::vector<SDockReference> x4_dockReferences;
rstl::reserved_vector<zeus::CVector3f, 4> x14_planeVertices;
2019-04-06 22:14:48 -07:00
bool x48_isReferenced = false;
2018-12-07 21:30:43 -08:00
public:
const rstl::reserved_vector<zeus::CVector3f, 4>& GetPlaneVertices() const { return x14_planeVertices; }
s32 GetReferenceCount() const { return x0_referenceCount; }
2018-12-07 21:30:43 -08:00
const std::vector<SDockReference>& GetDockRefs() const { return x4_dockReferences; }
Dock(CInputStream& in, const zeus::CTransform& xf);
TAreaId GetConnectedAreaId(s32 other) const;
s16 GetOtherDockNumber(s32 other) const;
bool GetShouldLoadOther(s32 other) const;
void SetShouldLoadOther(s32 other, bool should);
bool ShouldLoadOtherArea(s32 other) const;
zeus::CVector3f GetPoint(s32 idx) const;
bool IsReferenced() const { return x48_isReferenced; }
void SetReferenceCount(s32 v) {
x0_referenceCount = v;
x48_isReferenced = true;
}
};
virtual std::pair<std::unique_ptr<u8[]>, s32> IGetScriptingMemoryAlways() const = 0;
virtual s32 IGetAreaSaveId() const = 0;
2018-12-07 21:30:43 -08:00
virtual CAssetId IGetAreaAssetId() const = 0;
virtual bool IIsActive() const = 0;
virtual TAreaId IGetAttachedAreaId(int) const = 0;
virtual u32 IGetNumAttachedAreas() const = 0;
virtual CAssetId IGetStringTableAssetId() const = 0;
virtual const zeus::CTransform& IGetTM() const = 0;
};
enum class EChain {
Invalid = -1,
ToDeallocate,
Deallocated,
Loading,
Alive,
AliveJudgement,
};
2016-04-18 17:17:49 -07:00
2021-04-10 01:42:06 -07:00
} // namespace metaforce