Exemplo n.º 1
0
        private void MyDartboardListener_ThrowReceivedEvent(object sender, OnThrowReceivedArgs args)
        {
            CurrentGame.AddThrow(args.Points);

            if (CurrentGame.ThrowsCounter <= 3)
            {
                GameScoreUpdated?.Invoke(sender, new OnScoreUpdatedArgs(CurrentGame));
            }

            if (CurrentGame.IsComplete && CurrentGame.TotalScore >= BeerScoreLimit)
            {
                Console.WriteLine("Beer poured!");
                MyBeerPublisher.PourBeer();
                //CurrentGame.Reset();
                Console.WriteLine("Game complete.");
            }
            else if (CurrentGame.IsComplete)
            {
                //CurrentGame.Reset();
                Console.WriteLine("Game complete.");
            }
        }
Exemplo n.º 2
0
 public void AddThrowManually(int points)
 {
     CurrentGame.AddThrow(points);
 }