Răsfoiți Sursa

CGResource serialization

AlexVinS 9 ani în urmă
părinte
comite
97f19b5176
1 a modificat fișierele cu 6 adăugiri și 3 ștergeri
  1. 6 3
      lib/mapObjects/MiscObjects.cpp

+ 6 - 3
lib/mapObjects/MiscObjects.cpp

@@ -941,15 +941,18 @@ void CGResource::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer)
 
 
 void CGResource::writeJsonOptions(JsonNode& json) const
 void CGResource::writeJsonOptions(JsonNode& json) const
 {
 {
-
+	CCreatureSet::writeJson(json["guards"]);
+	json["amount"].Float() = amount;
+	json["guardMessage"].String() = message;
 }
 }
 
 
 void CGResource::readJsonOptions(const JsonNode& json)
 void CGResource::readJsonOptions(const JsonNode& json)
 {
 {
-
+	CCreatureSet::readJson(json["guards"]);
+	amount = json["amount"].Float();
+	message = json["guardMessage"].String();
 }
 }
 
 
-
 CGTeleport::CGTeleport() :
 CGTeleport::CGTeleport() :
 	type(UNKNOWN), channel(TeleportChannelID())
 	type(UNKNOWN), channel(TeleportChannelID())
 {
 {