AIsOfCatan.GameController.RoadConnected C# (CSharp) 메소드

RoadConnected() 개인적인 메소드

Figure out if a given edge on the board is connected to a given players road in some end
private RoadConnected ( IBoard board, Edge edge, int playerId ) : bool
board IBoard
edge Edge The edge to check
playerId int The id of the player to test
리턴 bool
        private bool RoadConnected(IBoard board, Edge edge, int playerId)
        {
            return board.GetAdjacentIntersections(edge)
                     .SelectMany(inter => board.GetAdjacentEdges(inter))
                     .Any(e => board.GetRoad(e) == playerId);
        }