Ejemplo n.º 1
0
        //sync =false
        public BehaviorExecution executeBehavior(Behavior behavior, InstanceSpecification host, Dictionary <string, ValueSpecification> p, bool sync)
        {
            _updateCurrentVirtualTime();
            BehaviorExecution newBe = behavior.createBehaviorExecution(host, p, sync);

            if (newBe != null)
            {
                newBe.Start          = currentVirtualTime;
                newBe.LastCalledTime = currentVirtualTime;
                if (sync)
                {
                    newBe.execute(0.00);//remplacer le double par un timespan?
                }
                else
                {
                    //Debug.Log("Adding behavior : " + newBe.name);
                    allBehaviors.Add(newBe);
                    _insert(newBe, 0.00);
                }
            }
            else
            {
                System.Console.WriteLine("Error on adding behavior : " + behavior.name + " for " + host.name);
            }
            return(newBe);
        }
Ejemplo n.º 2
0
 public override double execute(double dt)
 {
     return(behaviorExecution.execute(dt));
 }