1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

remove trivial manual implementation of assignment operator

fixes clang warning: Definition of implicit copy constructor for 'RiverType' is deprecated because it has a user-provided copy assignment operator
This commit is contained in:
Andrey Filipenkov 2022-09-30 11:26:36 +03:00
parent 35f2fb01ab
commit a11135152c
2 changed files with 1 additions and 51 deletions

View File

@ -397,30 +397,6 @@ TerrainType::TerrainType(const std::string& _name):
transitionRequired(false)
{
}
TerrainType& TerrainType::operator=(const TerrainType & other)
{
battleFields = other.battleFields;
prohibitTransitions = other.prohibitTransitions;
minimapBlocked = other.minimapBlocked;
minimapUnblocked = other.minimapUnblocked;
name = other.name;
musicFilename = other.musicFilename;
tilesFilename = other.tilesFilename;
terrainText = other.terrainText;
typeCode = other.typeCode;
terrainViewPatterns = other.terrainViewPatterns;
rockTerrain = other.rockTerrain;
river = other.river;
id = other.id;
moveCost = other.moveCost;
horseSoundId = other.horseSoundId;
passabilityType = other.passabilityType;
transitionRequired = other.transitionRequired;
return *this;
}
bool TerrainType::operator==(const TerrainType& other)
{
@ -474,16 +450,6 @@ RiverType::RiverType(const std::string & fileName, const std::string & code, Riv
{
}
RiverType& RiverType::operator=(const RiverType& other)
{
fileName = other.fileName;
code = other.code;
deltaName = other.deltaName;
id = other.id;
return *this;
}
RoadType::RoadType(const std::string& fileName, const std::string& code, RoadId id):
fileName(fileName),
code(code),
@ -492,14 +458,4 @@ RoadType::RoadType(const std::string& fileName, const std::string& code, RoadId
{
}
RoadType& RoadType::operator=(const RoadType& other)
{
fileName = other.fileName;
code = other.code;
id = other.id;
movementCost = other.movementCost;
return *this;
}
VCMI_LIB_NAMESPACE_END
VCMI_LIB_NAMESPACE_END

View File

@ -49,8 +49,6 @@ public:
bool transitionRequired;
TerrainType(const std::string & name = "");
TerrainType& operator=(const TerrainType & other);
bool operator==(const TerrainType & other);
bool operator!=(const TerrainType & other);
@ -99,8 +97,6 @@ public:
RiverType(const std::string & fileName = "", const std::string & code = "", RiverId id = River::NO_RIVER);
RiverType& operator=(const RiverType & other);
template <typename Handler> void serialize(Handler& h, const int version)
{
h & fileName;
@ -120,8 +116,6 @@ public:
RoadType(const std::string & fileName = "", const std::string& code = "", RoadId id = Road::NO_ROAD);
RoadType& operator=(const RoadType & other);
template <typename Handler> void serialize(Handler& h, const int version)
{
h & fileName;