예제 #1
0
 private bool RoundWonBy(GamePlayer player, MakeChoiceCommand command, List<IEvent> events)
 {
     events.Add(new RoundWonEvent(command.EntityId, player.Email, round));
     if (IsWinner(playerTwo))
     {
         GameWonBy(playerTwo, command, events);
         return false;
     }
     return true;
 }
예제 #2
0
 private bool IsWinner(GamePlayer player)
 {
     return (player.Score + 1) >= firstTo;
 }
예제 #3
0
 public void Handle(GameStartedEvent @event)
 {
     state = GameState.Started;
     playerTwo = new GamePlayer(@event.PlayerTwoId);
 }
예제 #4
0
 private void GameWonBy(GamePlayer player, MakeChoiceCommand command, List<IEvent> events)
 {
     events.Add(new GameWonEvent(command.EntityId, player.Email));
 }
예제 #5
0
 public void Handle(GameCreatedEvent @event)
 {
     id = @event.GameId;
     title = @event.Title;
     playerOne = new GamePlayer(@event.PlayerId);
     firstTo = @event.FirstTo;
 }