public void Aging() { BotNeeds CurrentNeeds = this.CurrentNeeds; // Initially randomize foreach (FieldInfo c in CurrentNeeds.GetType().GetFields()) { if (c.FieldType == typeof(float)) { CurrentNeeds.SetValue(c, CurrentNeeds, MyRandom.Next(100)); } } BotNeeds OneMinute = SimTypeSystem.GetObjectType("OnMinuteTimer").GetUsageActual("OnMinuteTimer"); while (true) { Actor.ScanNewObjects(2, Actor.SightRange, false); CurrentNeeds.AddFrom(OneMinute); CurrentNeeds.SetRange(0.0F, 100.0F); //SimPosition to = WorldObjects.Master.m_TheSimAvatar; //if (to != null) //{ // Console.WriteLine("Aging: " + this + " " + to.DistanceVectorString(this)); //} Thread.Sleep(60000); /// one minute /// Debug(CurrentNeeds.ToString()); } }
public void Aging() { BotNeeds OneMinute = SimTypeSystem.GetObjectType("OnMinuteTimer").GetUsageActual("OnMinuteTimer"); while (true) { Actor.ScanNewObjects(2, Actor.SightRange, false); CurrentNeeds.AddFrom(OneMinute); CurrentNeeds.SetRange(0.0F, 100.0F); //SimPosition to = WorldObjects.Master.m_TheSimAvatar; //if (to != null) //{ // Console.WriteLine("Aging: " + this + " " + to.DistanceVectorString(this)); //} Thread.Sleep(60000); /// one minute /// Debug(CurrentNeeds.ToString()); } }