Shipwright/ZAPDTR/ZAPD/ZRoom/Commands/SetRoomList.h
M4xw 5dda5762ba git subrepo clone https://github.com/HarbourMasters/ZAPDTR.git
subrepo:
  subdir:   "ZAPDTR"
  merged:   "a53a53ea4"
upstream:
  origin:   "https://github.com/HarbourMasters/ZAPDTR.git"
  branch:   "master"
  commit:   "a53a53ea4"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:54:48 +01:00

54 lines
1.2 KiB
C++

#pragma once
#include "ZRoom/ZRoomCommand.h"
class RoomEntry
{
public:
int32_t virtualAddressStart;
int32_t virtualAddressEnd;
RoomEntry(uint32_t nVAS, uint32_t nVAE);
RoomEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
size_t GetRawDataSize() const;
};
class RomFile : public ZResource
{
public:
RomFile(ZFile* nParent);
void ParseXML(tinyxml2::XMLElement* reader) override;
void ParseRawData() override;
Declaration* DeclareVar(const std::string& prefix, const std::string& body) override;
std::string GetBodySourceCode() const override;
void GetSourceOutputCode(const std::string& prefix) override;
std::string GetSourceTypeName() const override;
virtual ZResourceType GetResourceType() const override;
virtual size_t GetRawDataSize() const override;
uint8_t numRooms = 0;
std::vector<RoomEntry> rooms;
};
class SetRoomList : public ZRoomCommand
{
public:
// Borrowed reference. Don't delete.
RomFile* romfile = nullptr;
SetRoomList(ZFile* nParent);
void ParseRawData() override;
void DeclareReferences(const std::string& prefix) override;
std::string GetBodySourceCode() const override;
RoomCommand GetRoomCommand() const override;
std::string GetCommandCName() const override;
};