public static void InitializeCustomGrid(EmberGrid grid)
        {
            Grid = grid;

            // After map is created, we calibrate the light engine
            Grid.CalibrateLightEngine();
        }
        public static void InitializeCustomCells(int width, int height, EmberCell[] cells)
        {
            Grid = new EmberGrid(width, height, cells);

            // After map is created, we calibrate the light engine
            Grid.CalibrateLightEngine();
        }
        public static void InitializeBlueprint <T>() where T : Blueprint <EmberCell>, new()
        {
            Grid = new EmberGrid(new T());

            // After map is created, we calibrate the light engine
            Grid.CalibrateLightEngine();
        }
Exemple #4
0
        public static void InitializeBlueprint <T>(Blueprint <T> blueprint, bool saveGridData) where T : EmberCell, new()
        {
            if (!saveGridData)
            {
                Grid = new EmberGrid(blueprint.GridSizeX, blueprint.GridSizeY, blueprint.GetCells(), blueprint as Blueprint <EmberCell>);
                Grid.CalibrateLightEngine();
                return;
            }

            if (_blueprintGridCache.TryGetValue(blueprint.GetType(), out EmberGrid grid))
            {
                Grid = grid;
            }
            else
            {
                Grid = new EmberGrid(blueprint.GridSizeX, blueprint.GridSizeY, blueprint.GetCells(), blueprint as Blueprint <EmberCell>);
                Grid.CalibrateLightEngine();

                _blueprintGridCache.Add(blueprint.GetType(), Grid);
            }
        }
Exemple #5
0
        public static void InitializeBlueprint <T>(bool saveGridData) where T : Blueprint <EmberCell>, new()
        {
            if (!saveGridData)
            {
                Grid = new EmberGrid(new T());
                Grid.CalibrateLightEngine();
                return;
            }

            if (_blueprintGridCache.TryGetValue(typeof(T), out EmberGrid grid))
            {
                Grid = grid;
            }
            else
            {
                Grid = new EmberGrid(new T());
                Grid.CalibrateLightEngine();

                _blueprintGridCache.Add(typeof(T), Grid);
            }
        }