Пример #1
0
 private void DrawRoad(Graphics gfx, HexEdge edge, Road road)
 {
     var linePoints = HexEdgeToAbsolutePoints(edge);
     if (linePoints != null)
     {
         Pen p1 = new Pen(Color.Black, 5f);
         Pen p2 = new Pen(PlayerToColor(road.Player), 4f);
         gfx.DrawLine(p1, linePoints[0], linePoints[1]);
         gfx.DrawLine(p2, linePoints[0], linePoints[1]);
         p1.Dispose();
         p2.Dispose();
     }
 }
Пример #2
0
 /// <summary>
 /// Places a new road onto the board.
 /// </summary>
 public ActionResult PlaceRoad(int player, HexEdge edge, bool startOfGame)
 {
     var validationResult = ValidateRoadPlacement(player, edge, startOfGame);
     if (validationResult.Failed) return validationResult;
     _roads[edge] = new Road(player);
     return ActionResult.CreateSuccess();
 }