Exemplo n.º 1
0
 public Hexagon(IEnumerable<Hexagon> neighbours)
 {
     if (neighbours == null)
         Neighbours = new List<Hexagon>();
     else
         Neighbours = new List<Hexagon>(neighbours);
     Settlements = new Settlement[6];
     Roads = new Road[6];
 }
Exemplo n.º 2
0
 /// 
 /// <param name="player">Tulajdonos</param>
 /// <param name="position">hely</param>
 public void SetRoad(Player player, int position)
 {
     if (player == null) throw new ArgumentNullException("player");
     if (position >= 0 && position <= 5) {
         var road = new Road { Player = player };
         Roads[position] = road;
         player.Roads.Add(road);
         var hexagon = Neighbours[position];
         if (hexagon != null)
             Neighbours[position].Roads[(position + 3) % 6] = road;
     }
 }