1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 06:23:04 +01:00
Files
OpenRCT2/src/openrct2/object/SceneryGroupObject.h
James103 1d8dc111f1 Replace 2023 with 2024 in copyright headers (#21139)
Replace all instances of the year 2023 with 2024 in all copyright headers
2024-01-01 12:52:28 +01:00

52 lines
1.6 KiB
C++

/*****************************************************************************
* Copyright (c) 2014-2024 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "Object.h"
#include "SceneryGroupEntry.h"
#include <vector>
struct ObjectRepositoryItem;
enum class EntertainerCostume : uint8_t;
class SceneryGroupObject final : public Object
{
private:
SceneryGroupEntry _legacyType = {};
std::vector<ObjectEntryDescriptor> _items;
public:
void* GetLegacyData() override
{
return &_legacyType;
}
void ReadJson(IReadObjectContext* context, json_t& root) override;
void ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) override;
void Load() override;
void Unload() override;
void UpdateEntryIndexes();
void DrawPreview(DrawPixelInfo& dpi, int32_t width, int32_t height) const override;
void SetRepositoryItem(ObjectRepositoryItem* item) const override;
uint16_t GetNumIncludedObjects() const;
const std::vector<ObjectEntryDescriptor>& GetItems() const;
private:
static std::vector<ObjectEntryDescriptor> ReadItems(OpenRCT2::IStream* stream);
static uint32_t ReadJsonEntertainerCostumes(json_t& jCostumes);
static EntertainerCostume ParseEntertainerCostume(const std::string& s);
static std::vector<ObjectEntryDescriptor> ReadJsonEntries(IReadObjectContext* context, json_t& jEntries);
};