示例#1
0
        public static void Fill(this Cell cell, int x, int y, ITileMap map, GeneratorParams parameters)
        {
            Tile[,] template;

            switch (cell.Type)
            {
                case CellType.Room:
                    template = FillRoom(cell.Openings);
                    break;
                case CellType.Corridor:
                    template = FillCorridor(cell.Openings);
                    break;
                default:
                    return;
            }

            ApplyAttributes(cell, template);

            const int cs = CellBasedGenerator.CellSize;

            Iterate(template, ( loc, tile) => map[x*cs + loc.X, y*cs + loc.Y] = tile);
        }
 public CellBasedGenerator(GeneratorParams @params)
 {
     _params = @params;
 }