public void Checkout() { var currentRoundScoreAction = AverageScoreActionsPerRound.CheckoutScoreActions(); if (currentRoundScoreAction == null) { return; } AverageScoreActionsTotal.AddScoreAction(currentRoundScoreAction); OnPropertyChanged("CurrentScore"); }
public void AddScoreAction(ScoreAction scoreAction) { AverageScoreActionsPerRound.AddScoreAction(scoreAction); OnPropertyChanged("AverageScoreActionsPerRound"); if (CurrentScore > 1) { return; } if (CurrentScore < 0 || CurrentScore == 1 || (CurrentScore == 0 && scoreAction.Multiplier != 2)) { AverageScoreActionsPerRound.RevertAllScoreActions(); } OnPropertyChanged("AverageScoreActionsPerRound"); OnPropertyChanged("CurrentScore"); }
public void UndoLastScoreAction() { AverageScoreActionsPerRound.UndoLastScoreAction(); var scoreActionsToCheck = AverageScoreActionsPerRound.GetAllScoreActions(); AverageScoreActionsPerRound.Reset(); foreach (var scoreAction in scoreActionsToCheck) { AddScoreAction(new ScoreAction { Multiplier = scoreAction.Multiplier, Score = scoreAction.Score }); } OnPropertyChanged("CurrentScore"); }
private void ClearScoreActions(object obj) { AverageScoreActionsTotal.Reset(); AverageScoreActionsPerRound.Reset(); }