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)); } } }
private void AddLayer(int nX, int nY, LayerType layerType, int bitMaskValue, Tile[,] tileGrid) { tileGrid[nX, nY].AddLayer(GroundLayerController.GetLayerByBitMask(layerType, bitMaskValue)); }