2018-06-15 14:07:34 +02:00
|
|
|
/*****************************************************************************
|
2020-07-21 15:04:34 +02:00
|
|
|
* Copyright (c) 2014-2020 OpenRCT2 developers
|
2018-06-15 14:07:34 +02:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2016-06-15 14:59:01 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-01-02 20:36:42 +01:00
|
|
|
#include "../ride/Ride.h"
|
|
|
|
#include "../world/Banner.h"
|
|
|
|
#include "../world/Entrance.h"
|
2018-01-11 10:59:26 +01:00
|
|
|
#include "../world/Footpath.h"
|
|
|
|
#include "../world/Scenery.h"
|
|
|
|
#include "../world/Water.h"
|
2021-04-01 02:13:31 +02:00
|
|
|
#include "Object.h"
|
2018-01-02 20:36:42 +01:00
|
|
|
#include "ObjectLimits.h"
|
2016-06-15 14:59:01 +02:00
|
|
|
|
2021-04-01 02:13:31 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class ObjectList
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::vector<std::vector<ObjectEntryDescriptor>> _subLists;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void Add(const ObjectEntryDescriptor& entry);
|
|
|
|
std::vector<ObjectEntryDescriptor>& GetList(ObjectType type);
|
|
|
|
std::vector<ObjectEntryDescriptor>& GetList(ObjectType type) const;
|
|
|
|
const ObjectEntryDescriptor& GetObject(ObjectType type, ObjectEntryIndex index) const;
|
|
|
|
void SetObject(ObjectEntryIndex index, const ObjectEntryDescriptor& entry);
|
|
|
|
void SetObject(ObjectType type, ObjectEntryIndex index, std::string_view identifier);
|
2021-04-20 23:04:08 +02:00
|
|
|
ObjectEntryIndex Find(ObjectType type, std::string_view identifier);
|
2021-04-01 02:13:31 +02:00
|
|
|
|
|
|
|
struct const_iterator
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const ObjectList* _parent;
|
|
|
|
size_t _subList;
|
|
|
|
size_t _index;
|
|
|
|
|
|
|
|
void MoveToNextEntry();
|
|
|
|
|
|
|
|
public:
|
|
|
|
const_iterator(const ObjectList* parent, bool end);
|
|
|
|
const ObjectEntryDescriptor& operator*();
|
|
|
|
bool operator==(const_iterator& rhs);
|
|
|
|
bool operator!=(const_iterator& rhs);
|
|
|
|
const_iterator& operator++();
|
|
|
|
const_iterator operator++(int);
|
|
|
|
};
|
|
|
|
|
|
|
|
const_iterator begin() const;
|
|
|
|
const_iterator end() const;
|
|
|
|
};
|
|
|
|
|
2020-11-09 11:53:29 +01:00
|
|
|
void get_type_entry_index(size_t index, ObjectType* outObjectType, ObjectEntryIndex* outEntryIndex);
|