private bool CheckForLeftAndRightBounds(int id, TetronimoMovement move) { var row = GameTile.GetRowFromID(id); if (move == TetronimoMovement.Left && row == -0) { return(true); } else if (move == TetronimoMovement.Right && row == 9) { return(true); } else { return(false); } }
private int GetIDRelativFromOldID(int oldId, int zeile, int spalte) { int oldZeile = GameTile.GetColumnFromID(oldId); int oldSpalte = GameTile.GetRowFromID(oldId); int newZeile = oldZeile + zeile; if (newZeile > 33) { newZeile = newZeile - 34; } else if (newZeile < 0) { newZeile = newZeile + 34; } var newSpalte = oldSpalte + spalte; if (newSpalte < 0 || newSpalte > 9) { return(-1); } return(CreateID(newSpalte, newZeile)); }
private GameTile FindGameTileByID(int id) { return(m_GameGrid[GameTile.GetRowFromID(id), GameTile.GetColumnFromID(id)]); }
private void OverrideBlock(List <GameTile> newTetronimo, GameTile item, GameTile newBlock) { newBlock.Color = item.Color; newBlock.IsTetronimo = true; newTetronimo.Add(newBlock); }
private void OverrideBlock(BlockMovement moveDirection, List <GameTile> newTetronimo, GameTile item) { if (moveDirection == BlockMovement.Down) { OverrideBlock(newTetronimo, item, FindGameTileByID(FindBlockBelow(item.ID))); } else { OverrideBlock(newTetronimo, item, FindGameTileByID(FindBlock(item.ID, moveDirection))); } }
internal GameTileColorChangedEventArgs(GameTile tile) { NewGameTile = tile; }