1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00
vcmi/lib/rmg/ObjectInfo.h

45 lines
1.2 KiB
C++
Raw Normal View History

/*
* ObjectInfo.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "../mapObjects/ObjectTemplate.h"
#include "../mapObjects/CompoundMapObjectID.h"
VCMI_LIB_NAMESPACE_BEGIN
struct CompoundMapObjectID;
class CGObjectInstance;
struct DLL_LINKAGE ObjectInfo
{
2024-09-14 09:23:28 +02:00
ObjectInfo(si32 ID, si32 subID);
ObjectInfo(CompoundMapObjectID id);
ObjectInfo(const ObjectInfo & other);
ObjectInfo & operator=(const ObjectInfo & other);
std::vector<std::shared_ptr<const ObjectTemplate>> templates;
2024-09-14 09:23:28 +02:00
si32 primaryID;
si32 secondaryID;
ui32 value = 0;
ui16 probability = 0;
ui32 maxPerZone = 1;
//ui32 maxPerMap; //unused
std::function<CGObjectInstance *()> generateObject;
std::function<void(CGObjectInstance *)> destroyObject;
void setAllTemplates(MapObjectID type, MapObjectSubID subtype);
void setTemplates(MapObjectID type, MapObjectSubID subtype, TerrainId terrain);
2024-09-14 09:23:28 +02:00
CompoundMapObjectID getCompoundID() const;
//bool matchesId(const CompoundMapObjectID & id) const;
};
VCMI_LIB_NAMESPACE_END