internal void NextTurn(IGameTable gameTable) { if (!_playerEnumerator.MoveNext()) { _playerEnumerator.Reset(); _playerEnumerator.MoveNext(); } }
public ChessTableViewModel(IEventAggregator eg, IGameTable gt) { MoveAllowed = true; _gameTable = gt; _eventAggregator = eg; _gameTable.StartNewGame(); InitializeTableSquares(); InitializeEventHandlers(); RedrawTable(); }
public MenuViewModel(IGameTable gt, IEventAggregator ea) { _eventAggregator = ea; _gameTable = gt; LoadGameCommand = new DelegateCommand(LoadGameFromFen); SaveGameCommand = new DelegateCommand(SaveGame); OptionsCommand = new DelegateCommand(OptionsExecute); UndoLastMoveCommand = new DelegateCommand(UndoLastMove); NewGameCommand = new DelegateCommand(NewGame); MoveCommand = new DelegateCommand(MoveExecute); UserCommand = new DelegateCommand(UserExecute); // UserExecute(); }
public void Act(IGameTable gameTable) { _gameTable = gameTable; var result = Gateway.GenerateMove(gameTable.GetFen(), gameTable.Difficulty); var fromPosition = new Position(result.FromRank, result.FromFile); var toPosition = new Position(result.ToRank, result.ToFile); var promotedTo = result.PromotedTo; _gameTable.SetSelectedPiece(fromPosition); _gameTable.ParseInput(toPosition); if (promotedTo != ' ') { _gameTable.GetPieces().First(p => p.CurrentPosition == toPosition).Type = Helper.GetType(promotedTo); } _eventAggregator.GetEvent <RefreshTableEvent>().Publish(gameTable); }
private void InitializeRules(IGameTable gameTable) { _rules = new Dictionary <string, IRule>(); _rules.Add(RuleNames.Mate, new MateRule(() => gameTable.GetFen())); _rules.Add(RuleNames.Chess, new ChessRule(gameTable)); }
public RuleProvider(IGameTable gameTable) { InitializeRules(gameTable); }
public void Act(IGameTable g) { }
public NotificationViewModel(IEventAggregator evt, IGameTable gameTable) { _eventAggregator = evt; _gameTable = gameTable; InitializeEventHandlers(); }
public void Act(IGameTable gameTable) { var moveTask = new Task(GenerateMove, gameTable); moveTask.Start(); }
public Game(IGameTable table, int interval = 1000) { this.interval = interval; this.table = table; CurrentDirection = Direction.None; }
public ChessRule(IGameTable gameTable) { _gameTable = gameTable; }