Example #1
0
 private void OnDrawMove(Move obj)
 {
     Squares.ForEach(s =>
     {
         if (s.SquareState == SquareState.History)
         {
             s.SquareState = SquareState.Empty;
         }
     });
     Squares.First(s => s.Position == obj.From).SquareState = SquareState.History;
     Squares.First(s => s.Position == obj.To).SquareState   = SquareState.History;
 }
Example #2
0
 private void RedrawTable()
 {
     MoveAllowed = !_gameTable.CurrentPlayer.IsAutomatic;
     Squares.ForEach(s =>
     {
         s.SquareState    = SquareState.Empty;
         s.Representation = string.Empty;
     });
     _gameTable.GetPieces().ForEach(piece =>
                                    Squares.Single(s => s.Position == piece.CurrentPosition).Representation = string.Format("{0}{1}", piece.Color, piece.Type)
                                    );
     SelectSquare(_gameTable.SelectedSquare);
     if (_gameTable.CurrentPlayer.IsAutomatic)
     {
         return;
     }
     _gameTable.TableAttacks.ForEach(a => SetSquareState(a, SquareState.PosibleAttack));
     _gameTable.TableMoves.ForEach(a => SetSquareState(a, SquareState.PosibleMove));
 }
Example #3
0
 public void CalculationOneTimeGroup()
 {
     Horizontals.ForEach(gc => CalcCellCollection(gc));
     Verticals.ForEach(gc => CalcCellCollection(gc));
     Squares.ForEach(gc => CalcCellCollection(gc));
 }