Beispiel #1
0
 private ImmutableList <Turn> AddThrowIntoTurns(ThrowResult result)
 {
     if (!Turns.Any() || Turns.Last().Finished)
     {
         return(Turns
                .Add(new Turn(Score).WithAdditionalThrow(result)));
     }
     return(Turns
            .RemoveAt(Turns.Count - 1)
            .Add(Turns.Last().WithAdditionalThrow(result)));
 }
Beispiel #2
0
 private Choice StartNewTurn(Guid activePlayer, Guid nonActivePlayer)
 {
     if (ExtraTurns.Any())
     {
         Turns.Add(ExtraTurns.Dequeue());
     }
     else
     {
         Turns.Add(new Turn {
             ActivePlayer = activePlayer, NonActivePlayer = nonActivePlayer
         });
     }
     return(Turns.Last().Start(this, Turns.Count));
 }
Beispiel #3
0
 public Player FindPreviousPlayer()
 {
     return(Turns.Last().Player);
 }