Files
OpenRCT2-Web/src/object/Object.h
T

58 lines
1.8 KiB
C++
Raw Normal View History

#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#pragma once
#include "../common.h"
#include "ImageTable.h"
#include "StringTable.h"
extern "C"
{
#include "../object.h"
}
interface IStream;
2016-06-29 22:15:38 +01:00
struct ObjectRepositoryItem;
class Object
{
private:
2016-06-25 14:44:04 +01:00
rct_object_entry _objectEntry;
2016-06-26 21:20:32 +01:00
StringTable _stringTable;
ImageTable _imageTable;
2016-06-25 14:44:04 +01:00
protected:
2016-06-26 21:43:30 +01:00
StringTable * GetStringTable() { return &_stringTable; }
ImageTable * GetImageTable() { return &_imageTable; }
public:
2016-06-25 14:44:04 +01:00
explicit Object(const rct_object_entry &entry);
virtual ~Object() { }
// Legacy data structures
2016-06-25 14:44:04 +01:00
const rct_object_entry * GetObjectEntry() const { return &_objectEntry; }
virtual void * GetLegacyData() abstract;
2016-06-25 12:30:20 +01:00
virtual void ReadLegacy(IStream * stream) abstract;
virtual void Load() abstract;
virtual void Unload() abstract;
2016-06-25 16:34:35 +01:00
virtual uint8 GetObjectType() { return _objectEntry.flags & 0x0F; }
virtual const utf8 * GetName() abstract;
2016-06-29 22:15:38 +01:00
virtual void SetRepositoryItem(ObjectRepositoryItem * item) const { }
};