private void OnPersonReachedDemandHolder(string targetID) { float resource = demandKeeper.GetDemandResource(targetID); currentNeed.SatisfyNeed(resource, currentNeed.NeedType); UIManager.SetNeedValue(currentNeed.NeedType, currentNeed.GetRelativeLevel()); UIManager.HighlightOff(currentNeed.NeedType); }
private Need GetHighestDemand() { Need highestDemand = null; foreach (var demand in needs) { if (highestDemand == null) { highestDemand = demand; } if (demand.GetRelativeLevel() > highestDemand.GetRelativeLevel()) { highestDemand = demand; } } return(highestDemand); }