public virtual void InvokeBotSideEffect(SimAvatar TheBot) { Debug(TheBot, ToString()); //User.ApplyUpdate(use, simObject); BotNeeds CurrentNeeds = (BotNeeds)TheBot["CurrentNeeds"]; if (CurrentNeeds == null) { TheBot["CurrentNeeds"] = CurrentNeeds = new BotNeeds(90.0f); } BotNeeds needsBefore = CurrentNeeds.Copy(); BotNeeds update = Target.Affordances.GetActualUpdate(TypeUsage.UsageName); //TODO rate interaction and update TheBot.Assumptions CurrentNeeds.AddFrom(update); CurrentNeeds.SetRange(0.0F, 100.0F); BotNeeds difNeeds = CurrentNeeds.Minus(needsBefore); Debug(TheBot, TheBot + " " + ToString() + "\n\t " + TheBot.DistanceVectorString(Target) + "=> " + difNeeds.ShowNonZeroNeeds()); if (TheBot is SimActor) { ((SimActor)TheBot).ExecuteLisp(this, TypeUsage); } Thread.Sleep(TypeUsage.totalTimeMS); }
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()); } }