예제 #1
0
        public void SetBlock(short x, short y, ColorType colorType, bool checkClusters = true)
        {
            if (HasBlock(x, y))
            {
                GetBlock(x, y).Break();
            }

            Block block = new Block(this, x, y, colorType);

            Blocks[GetIndexForCoords(x, y)] = block;

            if (checkClusters)
            {
                int sameNeighboursCount = block.CountSameNeighbours();
            }

            if (TileMapObject != null)
            {
                block.CreateRepresentation(TileMapObject);
            }
        }