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; }
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)); }
public void CalculationOneTimeGroup() { Horizontals.ForEach(gc => CalcCellCollection(gc)); Verticals.ForEach(gc => CalcCellCollection(gc)); Squares.ForEach(gc => CalcCellCollection(gc)); }