/// <summary> /// uses new received track to update the cognitive intervention tree /// </summary> /// <param name="track"> track received from the game. </param> internal void addNewTrack(string track) { loggingCI("New track added: '" + track + "'."); CognitiveInterventionTree tree = getCognitiveInterventionTree(); foreach (CognitiveInterventionNode node in this.cognitiveInterventionTree.nodes) { node.wasActivatedThisUpdate = false; } List <string> listOfActiveNodeIds = tree.getListOfActiveNodeIds(); foreach (string nodeId in listOfActiveNodeIds) { CognitiveInterventionNode node = tree.getCognitiveInterventionNodeById(nodeId); if (node.isStillActive()) { if (node.edges.ContainsKey(track)) { if (node.edges[track].active) { tree.setActive(node, track); } } } } tree.logActiveNodes(); }
/// <summary> /// Method for intervention trigger check /// </summary> internal void refresh() { CognitiveInterventionTree tree = getCognitiveInterventionTree(); List <string> listOfActiveNodeIds = tree.getListOfActiveNodeIds(); foreach (string nodeId in listOfActiveNodeIds) { CognitiveInterventionNode node = tree.getCognitiveInterventionNodeById(nodeId); node.isStillActive(); } }