Beispiel #1
0
 public void Save(SerializableFleet serializable)
 {
     serializable.Factions        = Factions.Serialize();
     serializable.CombatTimeLimit = CombatTimeLimit.Value;
     serializable.LevelBonus      = LevelBonus.Value;
     serializable.NoRandomShips   = NoRandomShips;
     serializable.LootCondition   = (int)LootCondition;
     serializable.ExpCondition    = (int)ExpCondition;
     serializable.SpecificShips   = SpecificShips?.Select(item => item.Item.Id).ToArray();
 }
Beispiel #2
0
        public FleetSerializable Serialize()
        {
            var serializable = new FleetSerializable();

            serializable.Id              = ItemId.Id;
            serializable.FileName        = ItemId.Name;
            serializable.ItemType        = (int)ItemType.Fleet;
            serializable.Factions        = Factions.Serialize();
            serializable.LevelBonus      = LevelBonus.Value;
            serializable.NoRandomShips   = NoRandomShips;
            serializable.CombatTimeLimit = CombatTimeLimit.Value;
            serializable.LootCondition   = LootCondition;
            serializable.ExpCondition    = ExpCondition;
            serializable.SpecificShips   = SpecificShips?.Select(item => item.Item.Id).ToArray();
            return(serializable);
        }
Beispiel #3
0
 public void Save(FleetSerializable serializable)
 {
     serializable.Factions        = Factions.Serialize();
     serializable.LevelBonus      = LevelBonus.Value;
     serializable.NoRandomShips   = NoRandomShips;
     serializable.CombatTimeLimit = CombatTimeLimit.Value;
     serializable.LootCondition   = LootCondition;
     serializable.ExpCondition    = ExpCondition;
     if (SpecificShips == null || SpecificShips.Length == 0)
     {
         serializable.SpecificShips = null;
     }
     else
     {
         serializable.SpecificShips = SpecificShips.Select(wrapper => wrapper.Item.Value).ToArray();
     }
     OnDataSerialized(ref serializable);
 }