private void DetachFromArbiter() { ScoringRules arbiter = FindObjectOfType <ScoringRules>(); if (arbiter != null) { arbiter.OnPlayerScored -= OnPlayerScored; } }
private void AttachToArbiter() { ScoringRules arbiter = FindObjectOfType <ScoringRules>(); if (arbiter != null) { arbiter.OnPlayerScored += OnPlayerScored; } }
public ScoringSettings AddRule(int multiple, string score) { if (ScoringRules == null) { ScoringRules = new List <ScoringRule>() { new ScoringRule(multiple, score) }; } else { ScoringRules.Add(new ScoringRule(multiple, score)); } return(this); }
public void Evaluate(ScoringRules rules) { if (Status != CallForSpeechStatus.New) { throw new ApplicationException("Cannot accept application that isn't new"); } ScoreResult = rules.Evaluate(this); if (!ScoreResult.IsRed()) { Status = CallForSpeechStatus.EvaluatedByMachine; } else { Status = CallForSpeechStatus.Rejected; } }
public ExecutionStatus TryEvaluate(ScoringRules rules) { if (Status != CallForSpeechStatus.New) { return(ExecutionStatus.LogicError("Cannot accept application that isn't new")); } ScoreResult = rules.Evaluate(this); if (!ScoreResult.IsRed()) { Status = CallForSpeechStatus.EvaluatedByMachine; } else { Status = CallForSpeechStatus.Rejected; } return(ExecutionStatus.LogicOk()); }
public static IEnumerable <XElement> Construct() { var result = new List <XElement>(); var scoringRules = ScoringRules.Construct(ExtractionSettings.AssessmentScoring); var itemPool = ItemPool.Construct(ExtractionSettings.ItemInput, ExtractionSettings.AssessmentInfo.Publisher); var testBlueprint = TestBlueprint.Construct(ExtractionSettings.ItemInput, itemPool, ExtractionSettings.AssessmentInfo.UniqueId); var testForms = TestForm.Construct(ExtractionSettings.ItemInput, itemPool, ExtractionSettings.AssessmentInfo).ToList(); var performanceLevels = PerformanceLevels.Construct(ExtractionSettings.AssessmentInfo); var adminSegments = AdminSegment.Construct(itemPool, ExtractionSettings.ItemInput); var scoringSpecification = BuildGlobalProperties("scoring"); scoringSpecification.Add(new XElement("scoring", testBlueprint, itemPool, testForms, performanceLevels, scoringRules )); result.Add(scoringSpecification); var administrationSpecification = BuildGlobalProperties("administration"); administrationSpecification.Add(new XElement("administration", testBlueprint, PoolPropertyUtilities.GeneratePoolPropertyTypes(itemPool), PoolPropertyUtilities.GeneratePoolPropertyLanguages(itemPool), itemPool, testForms, adminSegments)); result.Add(administrationSpecification); return(result); }
public void selectSystem(ScoringRules rules) { _rules = rules; }
public void selectSystem(ScoringRules rules) { _rules = rules; }