public void Highlight(params IPositional[] positionals) { foreach (IPositional position in positionals) { HighlightedTiles.Add(this[position.X, position.Y]); } }
public void Highlight(IEnumerable <IPositional> positionals) { foreach (IPositional position in positionals) { HighlightedTiles.Add(this[position.X, position.Y]); } }
private void Game_GameOver(object sender, GameOverEventArgs e) { foreach (Tile tile in e.WinningTiles) { HighlightedTiles.Add(this[tile.X, tile.Y]); } }
public void ClearHighlightedTiles() { int count; while ((count = HighlightedTiles.Count) > 0) { HighlightedTiles.RemoveAt(count - 1); } }
public void Set(int x, int y, Piece piece) { if (x < 0 || x > Board.Width) { throw new ArgumentException("Value is out of range", nameof(x)); } if (y < 0 || y > Board.Height) { throw new ArgumentException("Value is out of range", nameof(y)); } TileVM tileVM = this[x, y]; tileVM.Piece = piece; HighlightedTiles.Add(tileVM); }
public void Clear(int x, int y) { if (x < 0 || x > Board.Width) { throw new ArgumentException("Value is out of range", nameof(x)); } if (y < 0 || y > Board.Height) { throw new ArgumentException("Value is out of range", nameof(y)); } TileVM tileVM = this[x, y]; tileVM.Piece = (Piece)Pieces.None; HighlightedTiles.Remove(tileVM); }