mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Make string instance names persistent
This commit is contained in:
@@ -118,14 +118,13 @@ public:
|
||||
/// If true hero can visit this object only from neighbouring tiles and can't stand on this object
|
||||
bool blockVisit;
|
||||
|
||||
std::string instanceName;
|
||||
std::string typeName;
|
||||
std::string subTypeName;
|
||||
|
||||
CGObjectInstance();
|
||||
~CGObjectInstance();
|
||||
|
||||
const std::string & getStringId() const;
|
||||
|
||||
/// "center" tile from which the sight distance is calculated
|
||||
int3 getSightCenter() const;
|
||||
|
||||
@@ -177,13 +176,13 @@ public:
|
||||
///Entry point of binary (de-)serialization
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & pos & ID & subID & id & tempOwner & blockVisit & appearance;
|
||||
//definfo is handled by map serializer
|
||||
|
||||
if(version >= 759)
|
||||
{
|
||||
h & typeName & subTypeName;
|
||||
h & instanceName & typeName & subTypeName;
|
||||
}
|
||||
|
||||
h & pos & ID & subID & id & tempOwner & blockVisit & appearance;
|
||||
//definfo is handled by map serializer
|
||||
}
|
||||
|
||||
///Entry point of Json (de-)serialization
|
||||
@@ -200,9 +199,6 @@ protected:
|
||||
virtual void serializeJsonOptions(JsonSerializeFormat & handler);
|
||||
|
||||
void serializeJsonOwner(JsonSerializeFormat & handler);
|
||||
|
||||
private:
|
||||
mutable std::string stringId;///<alternate id, dynamically generated, do not serialize
|
||||
};
|
||||
|
||||
/// function object which can be used to find an object with an specific sub ID
|
||||
|
||||
Reference in New Issue
Block a user