コード例 #1
0
        private void SpawnMiningBlocks()
        {
            if (_validIndexes == null)
            {
                return;
            }
            HexCellularAutomataIndependent miningAutomata = new HexCellularAutomataIndependent(_mapWidth, _mapHeight, _rnd);

            miningAutomata.RandomFillMap();

            miningAutomata.PlaceWalls_1D5678(1);
            //miningAutomata.PlaceWalls_1D5678_2D12(2); //<= GOOD
            miningAutomata.PlaceWalls_1D5678_2D1(1); //<= GOOD

            for (int i = 0; i < _size1D; i++)
            {
                if (Scene._grid[i].BasicValue == BasicValues.Ground /* && Scene._grid[i].ItemValue == 0*/) // _map
                {
                    if (miningAutomata.Map[i].BasicValue == BasicValues.Ground)
                    {
                        Scene._grid[i].ItemValue = ItemValues.MiningBlock;
                    }
                }
            }
        }
コード例 #2
0
        private void SpawnMiningBlocks()
        {
            if (_validIndexes == null)
                return;
            HexCellularAutomataIndependent miningAutomata = new HexCellularAutomataIndependent(_mapWidth, _mapHeight, _rnd);
            miningAutomata.RandomFillMap();

            miningAutomata.PlaceWalls_1D5678(1);
            //miningAutomata.PlaceWalls_1D5678_2D12(2); //<= GOOD
            miningAutomata.PlaceWalls_1D5678_2D1(1); //<= GOOD

            for (int i = 0; i < _size1D; i++)
            {
                if (Scene._grid[i].BasicValue == BasicValues.Ground/* && Scene._grid[i].ItemValue == 0*/) // _map
                {
                    if (miningAutomata.Map[i].BasicValue == BasicValues.Ground)
                        Scene._grid[i].ItemValue = ItemValues.MiningBlock;
                }
            }
        }