/// <summary>
/// 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
/// </summary>
/// <param name="firstTile">The first tile that the road will be along</param>
/// <param name="secondTile">The second tile that the road will be along</param>
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;
}