示例#1
0
 public void Highlight(params IPositional[] positionals)
 {
     foreach (IPositional position in positionals)
     {
         HighlightedTiles.Add(this[position.X, position.Y]);
     }
 }
示例#2
0
 public void Highlight(IEnumerable <IPositional> positionals)
 {
     foreach (IPositional position in positionals)
     {
         HighlightedTiles.Add(this[position.X, position.Y]);
     }
 }
示例#3
0
 private void Game_GameOver(object sender, GameOverEventArgs e)
 {
     foreach (Tile tile in e.WinningTiles)
     {
         HighlightedTiles.Add(this[tile.X, tile.Y]);
     }
 }
示例#4
0
        public void ClearHighlightedTiles()
        {
            int count;

            while ((count = HighlightedTiles.Count) > 0)
            {
                HighlightedTiles.RemoveAt(count - 1);
            }
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }