Beispiel #1
0
        public override IEnumerable <MapEntrance> GetOpenings()
        {
            if (carvedModule == null)
            {
                throw new InvalidOperationException("Module not assigned.");
            }

            return(entrances.Concat(carvedModule.GetOpenings()));
        }
Beispiel #2
0
 public void Draw(Rect nodeRect, MapGenModule module, bool isSelected)
 {
     if (module != null)
     {
         Texture boundaryTexture = isSelected ? activeSquare : inactiveSquare;
         Vector2 center          = WindowHelpers.RoundToLattice(nodeRect.center);
         Vector2 square          = SQUARE_SIZE * Vector2.one;
         Rect    rect            = new Rect(center, square);
         foreach (Coord coord in module.GetBoundary())
         {
             DrawBox(center, coord, rect, boundaryTexture);
         }
         Coord    mapSize  = module.GetMapSize();
         Boundary boundary = new Boundary(mapSize.x, mapSize.y);
         foreach (MapEntrance entrance in module.GetOpenings())
         {
             foreach (Coord coord in entrance.GetCoords(boundary))
             {
                 DrawBox(center, coord, rect, entranceSquare);
             }
         }
     }
 }
 public override IEnumerable <MapEntrance> GetOpenings()
 {
     return(entrances.Concat(carvedModule.GetOpenings()));
 }