/// <summary> /// Check if block in direction is same color and break it /// </summary> /// <param name="block"></param> /// <param name="dir"></param> public void CheckBreak(Block block, Direction dir) { Block other; switch (dir) { case Direction.up: other = block.GetTopAdjacent(); CompareAndBreak(block, other, dir); break; case Direction.right: other = block.GetRightAdjacent(); CompareAndBreak(block, other, dir); break; case Direction.down: other = block.GetBottomAdjacent(); CompareAndBreak(block, other, dir); break; case Direction.left: other = block.GetLeftAdjacent(); CompareAndBreak(block, other, dir); break; default: break; } }
public void DiamondLogic(Block block) { QueueBlockToBreak(block); Block otherBlock = block.GetBottomAdjacent(); if (otherBlock != null) { QueueColor(otherBlock.data.color); } }
/// <summary> /// width, 1 < y < height - 1 /// </summary> private void FormRight() { int currentHeight = (data.height - 1); Block current = data.topRight; while (currentHeight > 1) { current = current.GetBottomAdjacent(); current.SetSprite(BlockPosition.right); currentHeight--; } }