metaforce/Runtime/Character/CPOINode.hpp

72 lines
1.9 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CPOINODE_HPP__
#define __URDE_CPOINODE_HPP__
2016-04-11 07:10:28 +00:00
#include "IOStreams.hpp"
#include "CCharAnimTime.hpp"
namespace urde
{
2016-08-27 21:16:44 +00:00
class IAnimSourceInfo;
2016-04-11 07:10:28 +00:00
2016-08-21 20:39:18 +00:00
enum class EPOIType : u16
{
Loop = 0,
EmptyBool = 1,
EmptyInt32 = 2,
Particle = 5,
UserEvent = 6,
RandRate = 7,
Sound = 8,
};
2016-04-11 07:10:28 +00:00
class CPOINode
{
2016-04-12 06:15:32 +00:00
protected:
2016-04-11 07:10:28 +00:00
u16 x4_ = 1;
std::string x8_name;
2016-08-21 20:39:18 +00:00
EPOIType x18_type;
2016-04-11 07:10:28 +00:00
CCharAnimTime x1c_time;
u32 x24_index;
bool x28_;
2016-04-28 04:52:41 +00:00
float x2c_weight;
2016-08-21 20:39:18 +00:00
u32 x30_charIdx = -1;
u32 x34_flags;
2016-04-11 07:10:28 +00:00
public:
2016-08-21 20:39:18 +00:00
CPOINode(const std::string& name, EPOIType type, const CCharAnimTime& time,
u32 index, bool, float weight, u32 charIdx, u32 flags);
2016-04-11 07:10:28 +00:00
CPOINode(CInputStream& in);
virtual ~CPOINode() = default;
2016-04-11 07:47:21 +00:00
2016-09-11 18:40:33 +00:00
const std::string& GetString() const {return x8_name;}
2016-04-11 07:47:21 +00:00
const CCharAnimTime& GetTime() const {return x1c_time;}
2016-09-11 18:40:33 +00:00
void SetTime(const CCharAnimTime& time) { x1c_time = time; }
2016-08-21 20:39:18 +00:00
EPOIType GetPoiType() const { return x18_type; }
2016-04-12 06:15:32 +00:00
u32 GetIndex() const {return x24_index;}
2016-04-28 04:52:41 +00:00
float GetWeight() const { return x2c_weight; }
u32 GetCharacterIndex() const { return x30_charIdx; }
2016-08-21 20:39:18 +00:00
u32 GetFlags() const { return x34_flags; }
2016-09-11 18:40:33 +00:00
bool operator>(const CPOINode& other) const;
bool operator<(const CPOINode& other) const;
static bool compare(const CPOINode& a, const CPOINode& b);
2016-04-11 07:10:28 +00:00
};
2016-08-27 21:16:44 +00:00
template <class T>
u32 _getPOIList(const CCharAnimTime& time,
T* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<T>& stream,
const CCharAnimTime& curTime,
const IAnimSourceInfo& animInfo, u32 passedCount);
template <class T>
u32 _getPOIList(const CCharAnimTime& time,
T* listOut,
u32 capacity, u32 iterator, u32 unk1,
const std::vector<T>& stream,
const CCharAnimTime& curTime);
2016-04-11 07:10:28 +00:00
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CPOINODE_HPP__