Example #1
0
        public override Coord GetMapSize()
        {
            if (carvedModule == null)
            {
                throw new InvalidOperationException("Module not assigned.");
            }

            return(carvedModule.GetMapSize());
        }
Example #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 Coord GetMapSize()
 {
     return(carvedModule.GetMapSize());
 }