public void AfterFirstPlayerBoardShouldNotBeEmpty() { _context.ExecuteCommand(new PlayerSetCommand("X", 1, 1)); var board = _context.GetContextInstance <BoardContext>(); Assert.False(board.Board.All(b => b.All(f => f == " "))); }
public override EventResult HandleEvent(EventContext context, PlayerTouchedActorInstanceEvent @event) { switch (@event.TouchDirection) { case TouchDirection.FromBelow: context.ExecuteCommand(Commands.ActorInstanceMove(@event.Target, MoveDirection.Up)); break; case TouchDirection.FromAbove: context.ExecuteCommand(Commands.ActorInstanceMove(@event.Target, MoveDirection.Down)); break; case TouchDirection.FromLeft: context.ExecuteCommand(Commands.ActorInstanceMove(@event.Target, MoveDirection.Right)); break; case TouchDirection.FromRight: context.ExecuteCommand(Commands.ActorInstanceMove(@event.Target, MoveDirection.Left)); break; } return(EventResult.Completed); }
public void Apply(PlayerSet eventDto) { _context.ExecuteCommand(new SelectNextPlayerCommand()); }
public void OnClick(int row, int col) { _context.ExecuteCommand(new PlayerSetCommand(PlayersContext.CurrentPlayer, row, col)); OnPropertyChanged(); }