Esempio n. 1
0
 void Decide(List<Actions> decisions, ref Actions current)
 {
     var best_utility = -1f;
     foreach (var dd in decisions) {
         var utility = dd.utility(mech);
         utility     *= dd == current ? dd.commitmentBonus : 1;
         current      = best_utility < utility ? dd : current;
         best_utility = best_utility < utility ? utility : best_utility;
     }
     if (current != null) {
         current.enact(mech);
     } else {
         Debug.Log(name + " | action not set!");
     }
     // Debug.Log(name + " | Action: " + current.type + ", Utility: " + best_utility);
 }