2023-06-29 04:10:08 -04:00
|
|
|
#ifndef LEGOSTATE_H
|
|
|
|
#define LEGOSTATE_H
|
|
|
|
|
2023-10-16 14:17:23 -04:00
|
|
|
#include "decomp.h"
|
2024-02-23 10:06:16 -05:00
|
|
|
#include "misc/legostorage.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
#include "mxcore.h"
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d46c0
|
2024-01-29 13:54:47 -05:00
|
|
|
// SIZE 0x08
|
2023-10-24 19:38:27 -04:00
|
|
|
class LegoState : public MxCore {
|
2023-06-29 04:10:08 -04:00
|
|
|
public:
|
2024-06-13 14:10:19 -04:00
|
|
|
enum ScoreColor {
|
|
|
|
e_grey = 0,
|
|
|
|
e_yellow,
|
|
|
|
e_blue,
|
|
|
|
e_red
|
|
|
|
};
|
|
|
|
|
2024-01-30 13:57:20 -05:00
|
|
|
// SIZE 0x0c
|
2024-02-02 14:09:45 -05:00
|
|
|
class Playlist {
|
2024-02-01 18:08:56 -05:00
|
|
|
public:
|
2024-02-02 14:09:45 -05:00
|
|
|
enum Mode {
|
|
|
|
e_loop,
|
|
|
|
e_once,
|
|
|
|
e_random,
|
|
|
|
e_loopSkipFirst
|
|
|
|
};
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
// FUNCTION: LEGO1 0x10017c00
|
2024-02-02 14:09:45 -05:00
|
|
|
Playlist()
|
2024-02-01 18:08:56 -05:00
|
|
|
{
|
|
|
|
m_objectIds = NULL;
|
|
|
|
m_length = 0;
|
2024-02-02 14:09:45 -05:00
|
|
|
m_mode = e_loop;
|
|
|
|
m_nextIndex = 0;
|
2024-02-01 18:08:56 -05:00
|
|
|
}
|
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
Playlist(MxU32* p_objectIds, MxS16 p_length)
|
2024-01-31 09:47:15 -05:00
|
|
|
{
|
2024-02-01 18:08:56 -05:00
|
|
|
m_objectIds = p_objectIds;
|
|
|
|
m_length = p_length;
|
2024-02-02 14:09:45 -05:00
|
|
|
m_mode = e_loop;
|
|
|
|
m_nextIndex = 0;
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
2024-01-30 13:57:20 -05:00
|
|
|
|
2024-02-01 18:08:56 -05:00
|
|
|
// FUNCTION: LEGO1 0x10071800
|
2024-02-02 14:09:45 -05:00
|
|
|
Playlist& operator=(const Playlist& p_shuffle)
|
2024-02-01 18:08:56 -05:00
|
|
|
{
|
|
|
|
m_objectIds = p_shuffle.m_objectIds;
|
|
|
|
m_length = p_shuffle.m_length;
|
2024-02-02 14:09:45 -05:00
|
|
|
m_nextIndex = p_shuffle.m_nextIndex;
|
|
|
|
m_mode = p_shuffle.m_mode;
|
2024-02-01 18:08:56 -05:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2024-02-02 14:09:45 -05:00
|
|
|
MxU32 Next();
|
|
|
|
MxBool Contains(MxU32 p_objectId);
|
2024-02-01 18:08:56 -05:00
|
|
|
|
2024-07-04 19:06:32 -04:00
|
|
|
void SetUnknown0x08(MxS16 p_unk0x08) { m_nextIndex = p_unk0x08; }
|
2024-02-01 18:08:56 -05:00
|
|
|
|
2024-07-04 19:06:32 -04:00
|
|
|
MxResult ReadFromFile(LegoFile* p_file)
|
2024-06-14 17:24:34 -04:00
|
|
|
{
|
|
|
|
Read(p_file, &m_nextIndex);
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2024-07-04 19:06:32 -04:00
|
|
|
MxResult WriteToFile(LegoFile* p_file)
|
2024-06-14 17:24:34 -04:00
|
|
|
{
|
|
|
|
Write(p_file, m_nextIndex);
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2024-02-01 18:08:56 -05:00
|
|
|
private:
|
2024-02-02 14:09:45 -05:00
|
|
|
MxU32* m_objectIds; // 0x00
|
|
|
|
MxS16 m_length; // 0x04
|
|
|
|
MxS16 m_mode; // 0x06
|
|
|
|
MxS16 m_nextIndex; // 0x08
|
2024-01-30 13:57:20 -05:00
|
|
|
};
|
2024-06-13 14:32:28 -04:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10005f40
|
|
|
|
~LegoState() override {}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100060d0
|
2024-07-04 19:06:32 -04:00
|
|
|
const char* ClassName() const override // vtable+0x0c
|
2024-06-13 14:32:28 -04:00
|
|
|
{
|
|
|
|
// STRING: LEGO1 0x100f01b8
|
|
|
|
return "LegoState";
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100060e0
|
2024-07-04 19:06:32 -04:00
|
|
|
MxBool IsA(const char* p_name) const override // vtable+0x10
|
2024-06-13 14:32:28 -04:00
|
|
|
{
|
|
|
|
return !strcmp(p_name, LegoState::ClassName()) || MxCore::IsA(p_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10005f90
|
|
|
|
virtual MxBool IsSerializable() { return TRUE; } // vtable+0x14
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10005fa0
|
|
|
|
virtual MxBool SetFlag() { return FALSE; } // vtable+0x18
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10005fb0
|
2024-06-14 17:24:34 -04:00
|
|
|
virtual MxResult Serialize(LegoFile* p_file)
|
2024-06-13 14:32:28 -04:00
|
|
|
{
|
2024-06-14 17:24:34 -04:00
|
|
|
if (p_file->IsWriteMode()) {
|
|
|
|
p_file->WriteString(ClassName());
|
2024-06-13 14:32:28 -04:00
|
|
|
}
|
|
|
|
return SUCCESS;
|
|
|
|
} // vtable+0x1c
|
|
|
|
|
|
|
|
// SYNTHETIC: LEGO1 0x10006160
|
|
|
|
// LegoState::`scalar deleting destructor'
|
2023-06-29 04:10:08 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LEGOSTATE_H
|