public AttackerList(PirateGame game) { PirateList all = new PirateList(game.GetAllMyPirates().OrderBy(Pirate => Pirate.Location.Distance(game.GetMyCapsule().Location))); for (int i = 0; i < GameSettings.FORMATION_COUNT / 4; i++) { this.Add(new Attacker(all[0])); this.Add(new Attacker(all[1])); this.Add(new Attacker(all[2])); this.Add(new Attacker(all[3])); } }
public DefenderList(PirateGame game) { PirateList def = new PirateList(game.GetAllMyPirates().OrderBy(Pirate => Pirate.Location.Distance(game.GetMyCapsule().Location))); def.RemoveRange(0, 4); for (int i = 0; i < (def.Count / 2); i++) { this.Add(new Defender(def[i], Roles.front)); } for (int i = 0; i < def.Count - (def.Count / 2); i++) { this.Add(new Defender(def[i], Roles.backup)); } }