public void Apply(NGSatisfier sat) { foreach (KeyValuePair <NGObject, float> i in sat.influence) { this.Consume(i.Key, i.Value); } }
public void Apply(NGSatisfier sat) { foreach(KeyValuePair<NGObject, float> i in sat.influence) { this.Consume(i.Key,i.Value); } }
public NGSatisfier Add(string key, NGSatisfier sat) { if (!satisfiers.ContainsKey(key)) { satisfiers.Add(key, sat); } return(sat); }
public bool Can(NGSatisfier sat) { foreach (KeyValuePair<NGObject, float> o in sat.needed) { if (o.Value < this[o.Key].value) return false; } return true; }
public bool Can(NGSatisfier sat) { foreach (KeyValuePair <NGObject, float> o in sat.needed) { if (o.Value < this[o.Key].value) { return(false); } } return(true); }
public void InitNeedGreed() { n = new NeedGreed(); n.createStat(new Hunger()); n.createStat(new Fear()); n.createStat(new Money()); NGSatisfier food = new NGSatisfier("Food", new Dictionary<NGObject, float>() { { n.stats.Get("Hunger"), -0.5f }, { n.stats.Get("Money"), 0.3f } }, new Dictionary<NGObject,float>{{n.stats.Get("Money"), 0.3f}}); NGSatisfier work = new NGSatisfier("Work", new Dictionary<NGObject, float>() { { n.stats.Get("Hunger"), 0.7f }, { n.stats.Get("Money"), -0.5f } }, new Dictionary<NGObject, float> { { n.stats.Get("Hunger"), 0.7f } }); decsList = new List<NGSatisfier>() { food, work }; }
public NGSatisfier Add(string key, NGSatisfier sat) { if(!satisfiers.ContainsKey(key)) satisfiers.Add(key, sat); return sat; }
public Decision(NGSatisfier sat) { }