/// <summary> /// Initialise Region /// </summary> /// <param name="id">id</param> /// <param name="superRegion">SuperRegion</param> public Region(int id, SuperRegion superRegion) { this.id = id; this.superRegion = superRegion; this.neighbours = new BaseRegions(); player = PLAYER.UNKNOWN; armies = 2; }
/// <summary> /// Add SuperRegion (setup_map super_regions) /// </summary> /// <param name="superRegion">SuperRegion</param> public void AddSuperRegion(SuperRegion superRegion) { superRegions.Add(superRegion); }
// SuperRegions with least regions not mine public static Region BestTarget(SuperRegion SR) { return SR.RWhere(PLAYER.NOT_ME).SelectMany(Target => Target.Neighbours).Where(N => N.Player == PLAYER.ME).OrderByDescending(R => R.Neighbours.Count(N => N.Player == PLAYER.OTHER) * 2 + R.Neighbours.Count(N => N.Player == PLAYER.NEUTRAL)).First(); }