public override bool Check(IConditionScorer restictionData) { var currentCount = _scorers.GetScorer(restictionData.Scorer, restictionData.StageId); var value = (int)_logic.Calculate(restictionData.Value); return(restictionData.Operator.Check(currentCount, value)); }
public void CompleteAchievement(int achievementId) { var achievement = _accessor.Static.Achievements[achievementId]; var value = _scorersLogic.GetScorer(achievement.ScorerId, 0); var maxValue = _formula.Calculate(achievement.Value); if (value < maxValue) { throw new Exception($"error update achievement. value = {value} maxValue = {maxValue}"); } _impacts.ExecuteImpact(achievement.Impact); foreach (var temp in achievement.Items) { _dropLogic.Drop(temp.Value); } _accessor.State.Achievements[achievementId].Complete = true; LogicLog.CompleteAchievement(achievementId); }
public override double Calculate(IFormulaScorer formulaData) { return(_scorers.GetScorer(formulaData.Scorer, formulaData.StageId)); }