private void RecursiveTerritoryClaiming(PlayerModel player, BoardField field, int depth) { if (field == null) { return; } field.Owner = player; if (depth == 0) { return; } depth--; foreach (BoardField nextField in field.Neighbours.Values) { this.RecursiveTerritoryClaiming(player, nextField, depth); } }
public BoardField[] GetStartFields() { var fields = new BoardField[] { //convert to floor int this.Board[(int)(this.dimension.X / 4), (int)(this.dimension.Y / 4)], this.Board[(int)(this.dimension.X * 3 / 4), (int)(this.dimension.Y * 3 / 4)], this.Board[(int)(this.dimension.X * 3 / 4), (int)(this.dimension.Y / 4)], this.Board[(int)(this.dimension.X / 4), (int)(this.dimension.Y * 3 / 4)], this.Board[(int)(this.dimension.X / 2), (int)(this.dimension.Y * 3 / 4)], this.Board[(int)(this.dimension.X / 2), (int)(this.dimension.Y / 4)], this.Board[(int)(this.dimension.X * 3 / 4), (int)(this.dimension.Y / 2)], this.Board[(int)(this.dimension.X / 4), (int)(this.dimension.Y / 2)], }; return(fields); }