public virtual void Handle(ChoiceMadeEvent @event)
        {
            if (!_gameDetails.ContainsKey(@event.GameId)) return;

            var gameDetails = _gameDetails[@event.GameId];
            var round = gameDetails.Rounds.Single(r => r.Number == @event.Round);
            if(gameDetails.PlayerOneId == @event.PlayerId)
                round.PlayerOneHasMadeMove = true;
            else if(gameDetails.PlayerTwoId == @event.PlayerId)
                round.PlayerTwoHasMadeMove = true;
        }
Esempio n. 2
0
 public void Handle(ChoiceMadeEvent @event)
 {
     if (IsPlayerOne(@event.PlayerId))
         playerOne.CurrentChoice = @event.Choice;
     else if (IsPlayerTwo(@event.PlayerId))
         playerTwo.CurrentChoice = @event.Choice;
 }