Inheritance: Place, IVertex
示例#1
0
 public static ConsolePixel GetVertexPixel(Vertex vertex)
 {
     if (vertex.Campus != null)
     {
         return new ConsolePixel
                    {
                        BackColor = Transform(vertex.Campus.Color, true),
                        ForeColor = ConsoleColor.Black,
                        Char = (vertex.Campus.Type == CampusType.Traditional) ? 'T' : 'S',
                    };
     }
     if (!vertex.IsFreeToBuildCampus())
     {
         return EmptyVertex;
     }
     ITradingSite site = vertex.TradingSite;
     if (site == null)
     {
         return new ConsolePixel
                    {
                        Char = '*'
                    };
     }
     if (site == TradingSite.Instance)
     {
         return new ConsolePixel
                    {
                        Char = '?'
                    };
     }
     return new ConsolePixel
                {
                    Char = Transform(((SpecialTradingSite) site).TradeOutDegree)
                };
 }
示例#2
0
 internal void Add(Vertex vertex)
 {
     if (vertex == null)
     {
         return;
     }
     _vertices.Add(vertex);
 }
示例#3
0
 private void UpdateBuffer(Vertex vertex)
 {
     Position pos = HexPosToConsolePos(vertex.Position.HexPosition);
     switch (vertex.Position.Orientation)
     {
         case VertexOrientation.TopLeft:
             pos = pos.Add(-1, -2);
             break;
         case VertexOrientation.Left:
             pos = pos.Add(-3, 0);
             break;
         case VertexOrientation.BottomLeft:
             pos = pos.Add(-1, 2);
             break;
         case VertexOrientation.BottomRight:
             pos = pos.Add(1, 2);
             break;
         case VertexOrientation.Right:
             pos = pos.Add(3, 0);
             break;
         case VertexOrientation.TopRight:
             pos = pos.Add(1, -2);
             break;
     }
     _printBuffer[pos.Y, pos.X] = ConsolePixel.GetVertexPixel(vertex);
 }
示例#4
0
 public void BuildCampus(Vertex vertex, CampusType type, Color color)
 {
     vertex.BuildCampus(type, color);
 }