2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-11 07:10:28 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/IOStreams.hpp"
|
|
|
|
#include "Runtime/Character/CCharAnimTime.hpp"
|
2016-04-11 07:10:28 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-08-27 21:16:44 +00:00
|
|
|
class IAnimSourceInfo;
|
2016-04-11 07:10:28 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class EPOIType : u16 {
|
|
|
|
Loop = 0,
|
|
|
|
EmptyBool = 1,
|
|
|
|
EmptyInt32 = 2,
|
|
|
|
SoundInt32 = 4,
|
|
|
|
Particle = 5,
|
|
|
|
UserEvent = 6,
|
|
|
|
RandRate = 7,
|
|
|
|
Sound = 8,
|
2016-08-21 20:39:18 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CPOINode {
|
2016-04-12 06:15:32 +00:00
|
|
|
protected:
|
2018-12-08 05:30:43 +00:00
|
|
|
u16 x4_ = 1;
|
|
|
|
std::string x8_name;
|
|
|
|
EPOIType x18_type;
|
|
|
|
CCharAnimTime x1c_time;
|
|
|
|
s32 x24_index;
|
|
|
|
bool x28_unique;
|
|
|
|
float x2c_weight;
|
|
|
|
s32 x30_charIdx = -1;
|
|
|
|
s32 x34_flags;
|
2016-09-11 18:40:33 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CPOINode(std::string_view name, EPOIType type, const CCharAnimTime& time, s32 index, bool unique,
|
|
|
|
float weight, s32 charIdx, s32 flags);
|
|
|
|
explicit CPOINode(CInputStream& in);
|
2018-12-08 05:30:43 +00:00
|
|
|
virtual ~CPOINode() = default;
|
|
|
|
|
|
|
|
std::string_view GetString() const { return x8_name; }
|
|
|
|
const CCharAnimTime& GetTime() const { return x1c_time; }
|
|
|
|
void SetTime(const CCharAnimTime& time) { x1c_time = time; }
|
|
|
|
EPOIType GetPoiType() const { return x18_type; }
|
|
|
|
s32 GetIndex() const { return x24_index; }
|
|
|
|
bool GetUnique() const { return x28_unique; }
|
|
|
|
float GetWeight() const { return x2c_weight; }
|
|
|
|
s32 GetCharacterIndex() const { return x30_charIdx; }
|
|
|
|
s32 GetFlags() const { return x34_flags; }
|
|
|
|
|
|
|
|
bool operator>(const CPOINode& other) const;
|
|
|
|
bool operator<(const CPOINode& other) const;
|
2016-04-11 07:10:28 +00:00
|
|
|
};
|
|
|
|
|
2016-08-27 21:16:44 +00:00
|
|
|
template <class T>
|
2018-12-08 05:30:43 +00:00
|
|
|
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);
|
2016-08-27 21:16:44 +00:00
|
|
|
|
|
|
|
template <class T>
|
2018-12-08 05:30:43 +00:00
|
|
|
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
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|