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

37 lines
874 B
C++
Raw Normal View History

/*
* CompoundMapObjectID.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 "../constants/EntityIdentifiers.h"
VCMI_LIB_NAMESPACE_BEGIN
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);
}
};
VCMI_LIB_NAMESPACE_END