2021-01-01 23:24:29 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2021-03-20 12:02:12 -04:00
|
|
|
#include <vector>
|
2021-01-01 23:24:29 -05:00
|
|
|
|
2021-05-30 11:09:59 -04:00
|
|
|
#include "ZResource.h"
|
|
|
|
#include "ZRoomCommand.h"
|
|
|
|
#include "tinyxml2.h"
|
|
|
|
|
2021-01-01 23:24:29 -05:00
|
|
|
class ZRoom : public ZResource
|
|
|
|
{
|
|
|
|
public:
|
2021-10-17 07:32:09 -04:00
|
|
|
std::vector<ZRoomCommand*> commands;
|
2021-04-30 17:23:22 -04:00
|
|
|
int32_t roomCount; // Only valid for scenes
|
2021-01-01 23:24:29 -05:00
|
|
|
|
2021-10-17 07:32:09 -04:00
|
|
|
std::string hackMode;
|
|
|
|
|
|
|
|
ZResourceType zroomType = ZResourceType::Error;
|
|
|
|
ZResourceType parentZroomType = ZResourceType::Error;
|
2021-01-01 23:24:29 -05:00
|
|
|
|
2021-04-30 17:23:22 -04:00
|
|
|
ZRoom(ZFile* nParent);
|
|
|
|
virtual ~ZRoom();
|
|
|
|
|
2023-10-25 03:36:10 +02:00
|
|
|
void ExtractWithXML(tinyxml2::XMLElement* reader, uint32_t nRawDataIndex) override;
|
2021-10-17 07:32:09 -04:00
|
|
|
void ExtractFromBinary(uint32_t nRawDataIndex, ZResourceType parentType);
|
|
|
|
|
|
|
|
void ParseXML(tinyxml2::XMLElement* reader) override;
|
|
|
|
void ParseRawData() override;
|
|
|
|
void DeclareReferences(const std::string& prefix) override;
|
|
|
|
void ParseRawDataLate() override;
|
|
|
|
void DeclareReferencesLate(const std::string& prefix) override;
|
2021-05-30 11:09:59 -04:00
|
|
|
|
2021-10-17 07:32:09 -04:00
|
|
|
Declaration* DeclareVar(const std::string& prefix, const std::string& body) override;
|
|
|
|
std::string GetBodySourceCode() const override;
|
|
|
|
|
2021-12-03 15:57:05 -05:00
|
|
|
void GetSourceOutputCode(const std::string& prefix) override;
|
2021-10-17 07:32:09 -04:00
|
|
|
|
|
|
|
std::string GetDefaultName(const std::string& prefix) const override;
|
2021-01-01 23:24:29 -05:00
|
|
|
size_t GetCommandSizeFromNeighbor(ZRoomCommand* cmd);
|
|
|
|
ZRoomCommand* FindCommandOfType(RoomCommand cmdType);
|
|
|
|
|
2021-05-30 11:09:59 -04:00
|
|
|
size_t GetRawDataSize() const override;
|
2021-10-17 07:32:09 -04:00
|
|
|
std::string GetSourceTypeName() const override;
|
2021-05-30 11:09:59 -04:00
|
|
|
ZResourceType GetResourceType() const override;
|
2021-10-17 07:32:09 -04:00
|
|
|
|
|
|
|
protected:
|
2023-10-25 03:36:10 +02:00
|
|
|
void SyotesRoomFix();
|
2021-01-08 19:38:28 -05:00
|
|
|
};
|