Esempio n. 1
0
 public Vertex(Hexagon hex, VertexOrientation vo)
 {
     AdjacentForUpdate.Add(hex);
     _originalHexagon = hex;
     _originalOrientation = vo;
     Position = new VertexPosition(hex.Position, vo);
     Reset();
 }
Esempio n. 2
0
 public Vertex this[VertexPosition pos]
 {
     get
     {
         Hexagon hex = GetHexagonOrNull(pos.HexPosition);
         return hex != null ? hex[pos.Orientation] : null;
     }
 }
Esempio n. 3
0
 IVertex IBoard.this[VertexPosition pos]
 {
     get { return this[pos]; }
 }
Esempio n. 4
0
 public void UnBuildCampus(VertexPosition whereAt)
 {
     this[whereAt].DowngradeCampus();
 }
Esempio n. 5
0
 protected void BuildCampus(int x, int y, VertexOrientation vo, CampusType type)
 {
     var whereAt = new VertexPosition(new Position(x, y), vo);
     BuildCampus(whereAt, type);
 }
Esempio n. 6
0
 public void UndoBuildCampus(VertexPosition whereAt)
 {
     var vertex = Board[whereAt];
     CurrentUniversity.RemoveCampus(vertex);
     Board.UnBuildCampus(whereAt);
 }
Esempio n. 7
0
 public bool IsLegalToBuildCampus(VertexPosition whereAt, CampusType type)
 {
     Vertex vertex = Board[whereAt];
     if (vertex == null)
     {
         return false;
     }
     if (type == CampusType.Super)
     {
         return (vertex.Campus != null &&
                 vertex.Campus.Color == CurrentUniversityColor &&
                 vertex.Campus.Type == CampusType.Traditional);
     }
     // tranditional campus
     bool result = vertex.IsFreeToBuildCampus();
     if (CurrentPhase == GamePhase.Play)
     {
         result = result && vertex.Adjacent.Edges.Any(e => e.Color == CurrentUniversityColor);
     }
     return result;
 }
Esempio n. 8
0
 public void BuildCampus(VertexPosition whereAt, CampusType type)
 {
     var vertex = Board[whereAt];
     Board.BuildCampus(vertex, type, CurrentUniversity.Color);
     CurrentUniversity.AddCampus(vertex, type);
 }
Esempio n. 9
0
 internal void AcquireInitialStudents(VertexPosition vertexPosition)
 {
     IEnumerable<DegreeType> degrees = _game.Board[vertexPosition].Adjacent.Hexagons.Select(h => h.Degree);
     foreach (DegreeType degree in degrees)
     {
         if (degree != DegreeType.None)
         {
             Students[degree] += 1;
         }
     }
 }
Esempio n. 10
0
 public void HashVertex(Color color, VertexPosition vPos, CampusType type)
 {
     Vertex vertex = _game.Board[vPos];
     Hash ^= _coloredHashing[color].CampusHash[type][vertex];
 }
Esempio n. 11
0
 public BuildCampusMove(VertexPosition where, CampusType type)
 {
     WhereAt = where;
     CampusType = type;
 }
Esempio n. 12
0
 public void HashVertex(Color color, VertexPosition vPos, CampusType type)
 {
 }