public Board(List <Cow> nodes, GameState state)// Constructor for the board object { this.nodes = nodes ?? throw new ArgumentNullException(nameof(nodes)); this.state = state; currentMills = new Mills(); mills = new PossibleMills(); adjacent = new AdjacentPositions(); }
public bool CheckIndexForMill(int index, Player player)//Takes a node index and a player to see if that player has a mill from that node { Cow cow = player.GetCow(); Mills mills = this.mills.GetMillsByIndex(index); foreach (Mill mill in mills.GetMills()) { if (CheckMillAgainstBoard(mill, cow)) { currentMills.Add(mill); return(true); } } return(false); }