public void AddToCellWalls(CellWall wall)
 {
     if (!AllCellWalls.Contains(wall))
     {
         AllCellWalls.Add(wall);
     }
     else
     {
         var existingWall = AllCellWalls.FirstOrDefault(w => w.Equals(wall));
         AllCellWalls.Add(existingWall);
     }
 }
Exemple #2
0
        //TODO: Creating a cell should:
        //1. Create the walls and add the unique ones to the list of walls
        //2. Create the vertices and add the unique ones to the list of vertices
        //3. Create an enum for labelling the Cell Vertices (Ortho, Para, Meta, Normal, Anti-Ortho, Anti-Meta)
        //4. Create an enum for labelling the Cell Walls, among other things (use Quark types for directions)

        public Cell(CartesianCoord center, int cellSize, Orientation orientation, HexGrid hexGrid)
        {
            Center = center;
            for (int i = 0; i < 6; i++)
            {
                var origin = new Vertex(center, cellSize, i);
                //CellFactory.AddToVertices(hexGrid, this, origin.Center);
                var end = new Vertex(center, cellSize, i + 1);
                hexGrid.AddToVertices(end);
                var wall = new CellWall(origin, end);
                hexGrid.AddToCellWalls(wall);
            }
        }