Exemplo n.º 1
0
        private void AddLayerCorner(int nX, int nY, LayerType layerType, int bitMaskValue, Tile[,] tileGrid)
        {
            Tile tile = tileGrid[nX, nY];

            if (bitMaskValue == 1) //NorthWest
            {
                if (!tile.IsBitMaskIdInList(layerType, 128) && !tile.IsBitMaskIdInList(layerType, 2))
                {
                    tileGrid[nX, nY].AddLayer(GroundLayerController.GetLayerByBitMask(layerType, bitMaskValue));
                }
            }
            if (bitMaskValue == 4) //NorhtEast
            {
                if (!tile.IsBitMaskIdInList(layerType, 2) && !tile.IsBitMaskIdInList(layerType, 8))
                {
                    tileGrid[nX, nY].AddLayer(GroundLayerController.GetLayerByBitMask(layerType, bitMaskValue));
                }
            }
            if (bitMaskValue == 16) //SouthEast
            {
                if (!tile.IsBitMaskIdInList(layerType, 8) && !tile.IsBitMaskIdInList(layerType, 32))
                {
                    tileGrid[nX, nY].AddLayer(GroundLayerController.GetLayerByBitMask(layerType, bitMaskValue));
                }
            }
            if (bitMaskValue == 64) //SouthWest
            {
                if (!tile.IsBitMaskIdInList(layerType, 32) && !tile.IsBitMaskIdInList(layerType, 64))
                {
                    tileGrid[nX, nY].AddLayer(GroundLayerController.GetLayerByBitMask(layerType, bitMaskValue));
                }
            }
        }
Exemplo n.º 2
0
 private void AddLayer(int nX, int nY, LayerType layerType, int bitMaskValue, Tile[,] tileGrid)
 {
     tileGrid[nX, nY].AddLayer(GroundLayerController.GetLayerByBitMask(layerType, bitMaskValue));
 }