metaforce/Runtime/Character/CPOINode.hpp

65 lines
1.8 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-04-11 00:10:28 -07:00
#include <string>
#include <vector>
#include "Runtime/Streams/IOStreams.hpp"
#include "Runtime/Character/CCharAnimTime.hpp"
2016-04-11 00:10:28 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
2016-08-27 14:16:44 -07:00
class IAnimSourceInfo;
2016-04-11 00:10:28 -07:00
2018-12-07 21:30:43 -08:00
enum class EPOIType : u16 {
Loop = 0,
EmptyBool = 1,
EmptyInt32 = 2,
SoundInt32 = 4,
Particle = 5,
UserEvent = 6,
RandRate = 7,
Sound = 8,
2016-08-21 13:39:18 -07:00
};
2018-12-07 21:30:43 -08:00
class CPOINode {
2016-04-11 23:15:32 -07:00
protected:
2018-12-07 21:30:43 -08: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 11:40:33 -07:00
2018-12-07 21:30:43 -08:00
public:
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-07 21:30:43 -08: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 00:10:28 -07:00
};
2016-08-27 14:16:44 -07:00
template <class T>
size_t _getPOIList(const CCharAnimTime& time, T* listOut, size_t capacity, size_t iterator, u32 unk1,
const std::vector<T>& stream, const CCharAnimTime& curTime, const IAnimSourceInfo& animInfo,
size_t passedCount);
2016-08-27 14:16:44 -07:00
template <class T>
size_t _getPOIList(const CCharAnimTime& time, T* listOut, size_t capacity, size_t iterator, u32 unk1,
const std::vector<T>& stream, const CCharAnimTime& curTime);
2016-04-11 00:10:28 -07:00
2021-04-10 01:42:06 -07:00
} // namespace metaforce