Esempio n. 1
0
 public EnercitiesGameInfo(EnercitiesGameInfo gameInfo)
 {
     this.Level = gameInfo.Level;
     this.Population = gameInfo.Population;
     this.TargetPopulation = gameInfo.TargetPopulation;
     this.Money = gameInfo.Money;
     this.MoneyEarning = gameInfo.MoneyEarning;
     this.Oil = gameInfo.Oil;
     this.PowerConsumption = gameInfo.PowerConsumption;
     this.PowerProduction = gameInfo.PowerProduction;
     this.EnvironmentScore = gameInfo.EnvironmentScore;
     this.EconomyScore = gameInfo.EconomyScore;
     this.WellbeingScore = gameInfo.WellbeingScore;
     this.GlobalScore = gameInfo.GlobalScore;
     this.CurrentRole = gameInfo.CurrentRole;
 }
Esempio n. 2
0
 public static EnercitiesGameInfo DeserializeFromJson(string serialized)
 {
     try
     {
         var textReader = new StringReader(serialized);
         var serializer = new JsonSerializer();
         _lastDeserializedState =
             (EnercitiesGameInfo) serializer.Deserialize(textReader, typeof (EnercitiesGameInfo));
     }
     catch (Exception e)
     {
         Console.WriteLine("Failed to deserialize EnercitiesGameInfo from '" + serialized + "': " + e.Message);
     }
     return _lastDeserializedState;
 }
Esempio n. 3
0
 public bool Equals(EnercitiesGameInfo other)
 {
     return Level == other.Level &&
            Population == other.Population &&
            TargetPopulation == other.TargetPopulation &&
            Money.Equals(other.Money) &&
            MoneyEarning.Equals(other.MoneyEarning) &&
            Oil.Equals(other.Oil) &&
            PowerConsumption.Equals(other.PowerConsumption) &&
            PowerProduction.Equals(other.PowerProduction) &&
            EnvironmentScore.Equals(other.EnvironmentScore) &&
            EconomyScore.Equals(other.EconomyScore) &&
            WellbeingScore.Equals(other.WellbeingScore) &&
            GlobalScore.Equals(other.GlobalScore) &&
            CurrentRole == other.CurrentRole;
 }