2024-08-21 20:16:41 +02:00
|
|
|
/*
|
|
|
|
* 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"
|
2024-09-14 08:55:28 +02:00
|
|
|
#include "../mapObjects/CompoundMapObjectID.h"
|
2024-08-21 20:16:41 +02:00
|
|
|
|
|
|
|
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);
|
2024-08-21 20:16:41 +02:00
|
|
|
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;
|
2024-08-21 20:16:41 +02:00
|
|
|
ui32 value = 0;
|
|
|
|
ui16 probability = 0;
|
|
|
|
ui32 maxPerZone = 1;
|
|
|
|
//ui32 maxPerMap; //unused
|
|
|
|
std::function<CGObjectInstance *()> generateObject;
|
|
|
|
std::function<void(CGObjectInstance *)> destroyObject;
|
|
|
|
|
2024-09-12 21:04:27 +02:00
|
|
|
void setAllTemplates(MapObjectID type, MapObjectSubID subtype);
|
2024-08-21 20:16:41 +02:00
|
|
|
void setTemplates(MapObjectID type, MapObjectSubID subtype, TerrainId terrain);
|
|
|
|
|
2024-09-14 09:23:28 +02:00
|
|
|
CompoundMapObjectID getCompoundID() const;
|
2024-08-21 20:16:41 +02:00
|
|
|
//bool matchesId(const CompoundMapObjectID & id) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|