private InteractionIdentifier getInteractionIdentifier() { InteractionIdentifier interactionIdentifier = new InteractionIdentifier(); interactionIdentifier.interactionId = "123456"; interactionIdentifier.scopingEntityId = "gov.nyc.health"; return(interactionIdentifier); }
private int getScoreFromInteractionIdentifier(InteractionIdentifier interaction) { if (Service.Get <ActionButtonRequestRuleService>().ContainsRule(interaction.ID)) { ActionButtonRequestRuleDefinition rule = Service.Get <ActionButtonRequestRuleService>().GetRule(interaction.ID); return(100 - rule.Priority); } return(-1); }
public string evaluate(string cdsInputString, string scopingEntityId, string businessId, string version) { string METHODNAME = "evaluate "; if (true) { Console.WriteLine(METHODNAME + "calling evaluate with businessId '" + businessId + "; scopingEntityId " + scopingEntityId + "; version " + version + "' @ " + endPoint + " with requestTimeout:" + requestTimeout + " and connectTimeout:" + connectTimeout); } evaluateResponse response = null; string result = null; InteractionIdentifier interactionIdentifier = getInteractionIdentifier(); EvaluationRequest evaluationRequest = getEvaluationRequest(encodeTo64(cdsInputString), scopingEntityId, businessId, version); evaluate e = new evaluate(); e.interactionId = interactionIdentifier; e.evaluationRequest = evaluationRequest; response = service.evaluate(e); if (response == null) { throw new Exception("response is null!"); } EvaluationResponse er = response.evaluationResponse; FinalKMEvaluationResponse[] finalKMEvaluationResponse = er.finalKMEvaluationResponse; if (finalKMEvaluationResponse == null) { throw new Exception("finalKMEvaluationResponse is null!"); } if (finalKMEvaluationResponse.Length != 1) { throw new Exception("finalKMEvaluationResponse size wrong: " + finalKMEvaluationResponse.Length); } FinalKMEvaluationResponse kmEvaluationResponse = finalKMEvaluationResponse[0]; KMEvaluationResultData[] kmEvaluationResultData = kmEvaluationResponse.kmEvaluationResultData; if (kmEvaluationResultData == null) { throw new Exception("kmEvaluationResultData is null!"); } if (kmEvaluationResultData.Length != 1) { throw new Exception("kmEvaluationResultData size wrong: " + kmEvaluationResultData.Length); } KMEvaluationResultData resultData = kmEvaluationResultData[0]; if (resultData == null) { throw new Exception("resultData is null!"); } SemanticPayload data = resultData.data; if (data == null) { throw new Exception("data is null!"); } result = decodeFrom64(data.base64EncodedPayload); if (result == null) { throw new Exception("result is null!"); } return(result); }
public override void AssignPointsToCompetitors(List <Competitor <GameObject> > competitors) { for (int i = 0; i < competitors.Count; i++) { Competitor <GameObject> competitor = competitors[i]; if (competitor.Value.IsDestroyed()) { competitor.Points = 0; continue; } FilterTriggerAction component = competitor.Value.GetComponent <FilterTriggerAction>(); if (component != null && !checkCanInteractWithFilter(competitor.Value, component)) { competitor.Points = 0; continue; } ForceInteractionAction component2 = competitor.Value.GetComponent <ForceInteractionAction>(); if (component2 != null) { competitor.Points = 100; continue; } InteractionIdentifier component3 = competitor.Value.GetComponent <InteractionIdentifier>(); if (component3 != null) { competitor.Points = getScoreFromInteractionIdentifier(component3); continue; } GameObject gameObject = null; if (DataEntityCollection.TryGetComponent <GameObjectReferenceData>(PlayerHandle, out var component4)) { gameObject = component4.GameObject; } bool flag = participation.ParticipatingGO == competitor && participation.CurrentParticipationState == ParticipationState.Participating; bool flag2 = competitor.Value.GetComponent <PropExperience>() != null && gameObject != null && !gameObject.IsDestroyed() && competitor.Value.transform.root == gameObject.transform; if (flag || flag2) { competitor.Points = 95; continue; } bool flag3 = competitor.Value.GetComponent <Prop>() != null; bool flag4 = competitor.Value.GetComponent <SendQuestEvent>() != null; bool flag5 = competitor.Value.GetComponent <Action>() != null; bool flag6 = competitor.Value.GetComponent <PropExperience>() != null; if (flag3) { competitor.Points = 94; } if (flag4) { competitor.Points = 80; } if (flag5) { competitor.Points = 70; } if (flag6) { competitor.Points = 60; } } }
private InteractionIdentifier getInteractionIdentifier() { InteractionIdentifier interactionIdentifier = new InteractionIdentifier(); interactionIdentifier.interactionId = "123456"; interactionIdentifier.scopingEntityId = "gov.nyc.health"; return interactionIdentifier; }