public Game_Battalions(Game_Battalions battalions) { Current_Battalion = battalions.Current_Battalion; Data = battalions.Data .Select(pair => new KeyValuePair <int, Battalion>(pair.Key, new Battalion(pair.Value))) .ToDictionary(p => p.Key, p => p.Value); Individual_Animations = new List <int>(battalions.Individual_Animations); Convoys = battalions.Convoys .Select(pair => new KeyValuePair <int, Game_Convoy>(pair.Key, new Game_Convoy(pair.Value))) .ToDictionary(p => p.Key, p => p.Value); //Convoys = battalions.Convoys.Select(pair => new KeyValuePair<int, List<Item_Data>>(pair.Key, //Debug // new List<Item_Data>(pair.Value.Select(x => new Item_Data(x))))) // .ToDictionary(p => p.Key, p => p.Value); }
public void copy_battalion_to(Game_Battalions target, int battalion_id) { target.Data[battalion_id] = Data[battalion_id]; if (Convoys.Count > 1 || target.Convoys.Count > 1) // I suspect this might break with multiple convoys, setting a break here to test it //Yeti { int x = 0; x++; } foreach (var pair in Convoys) { target.Convoys[pair.Key] = pair.Value; } //if (Data[battalion_id].convoy_id != -1) //Debug // target.Convoys[Data[battalion_id].convoy_id] = Convoys[Data[battalion_id].convoy_id]; }