AIsOfCatan.StartActions.BuildRoad C# (CSharp) Метод

BuildRoad() публичный Метод

Build a road on the board If you try to build at a position not connected to the newly placed settlement an IllegalBuildPositionException is thrown If you try to build more than one road an IllegalActionException is thrown
public BuildRoad ( Edge edge ) : void
edge AIsOfCatan.API.Edge
Результат void
        public void BuildRoad(Edge edge)
        {
            if (roadBuilt) throw new IllegalActionException("Only one road may be built in a turn during the startup");
            if (!settlementBuilt) throw new IllegalActionException("The settlement must be placed before the road");
            int[] array = new int[] { settlementPosition.FirstTile, settlementPosition.SecondTile, settlementPosition.ThirdTile };
            if (!(array.Contains(edge.FirstTile) && array.Contains(edge.SecondTile)))
                throw new IllegalBuildPositionException("The road must be placed next to the settlement");
            roadPosition = edge;
            controller.BuildFirstRoad(player, edge);
            roadBuilt = true;
        }