1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Move CompoundMapObjectID to separate file

This commit is contained in:
Tomasz Zieliński
2024-09-14 08:55:28 +02:00
parent e89649ec1c
commit 9591ce1ab4
9 changed files with 50 additions and 26 deletions

View File

@ -9,7 +9,7 @@
*/
#pragma once
#include "../constants/EntityIdentifiers.h"
#include "../mapObjects/CompoundMapObjectID.h"
#include "../IHandlerBase.h"
#include "../json/JsonNode.h"
@ -19,27 +19,6 @@ class AObjectTypeHandler;
class ObjectTemplate;
struct SObjectSounds;
struct DLL_LINKAGE CompoundMapObjectID
{
si32 primaryID;
si32 secondaryID;
CompoundMapObjectID(si32 primID, si32 secID) : primaryID(primID), secondaryID(secID) {};
bool operator<(const CompoundMapObjectID& other) const
{
if(this->primaryID != other.primaryID)
return this->primaryID < other.primaryID;
else
return this->secondaryID < other.secondaryID;
}
bool operator==(const CompoundMapObjectID& other) const
{
return (this->primaryID == other.primaryID) && (this->secondaryID == other.secondaryID);
}
};
class CGObjectInstance;
using TObjectTypeHandler = std::shared_ptr<AObjectTypeHandler>;