public override BehaviorExecution InstanciateOpaqueBehavior(Mascaret.Behavior behavior, string typeName, InstanceSpecification host, Dictionary <string, ValueSpecification> p)
    {
        //Type type = Types. GetType( typeName,"Assembly-CSharp");
        Type type            = Type.GetType(typeName);
        BehaviorExecution be = null;

        if (type != null)
        {
            be = (BehaviorExecution)(Activator.CreateInstance(type));
        }
        // Use the Unity Monobehaviour method
        else
        {
            be = this.GetUnityBehaviourExecution(typeName, host, p);
        }

        if (be != null)
        {
            be.init(behavior, host, p, false);
        }
        else
        {
            PrintSingleton.Instance.log("ERREUR : " + typeName + " not found");
        }

        return(be);
    }
Exemplo n.º 2
0
 public void addOwnedBehavior(Behavior element)
 {
     ownedBehavior.Add(element.name, element);
     foreach (Classifier child in children)
     {
         child.addOwnedBehavior(element);
     }
 }
    public override BehaviorExecution InstanciateOpaqueBehavior(Mascaret.Behavior behavior, string typeName, InstanceSpecification host, Dictionary <string, ValueSpecification> p)
    {
        Type type            = Types.GetType(typeName, "Assembly-CSharp");
        BehaviorExecution be = null;

        if (type != null)
        {
            be = (BehaviorExecution)(Activator.CreateInstance(type));
        }
        else
        {
            Debug.Log("ERREUR : " + typeName + " not found");
        }

        if (be != null)
        {
            be.init(behavior, host, p, false);
        }
        return(be);
    }
Exemplo n.º 4
0
 public ActionListenerBehavior(Behavior specif, InstanceSpecification host, Dictionary<String, ValueSpecification> p)
     : base(specif, host, p)
 {
 }
 public ConversationalBehaviourExecution(Behavior specif, InstanceSpecification host, Dictionary<String, ValueSpecification> p)
 {
 }
 public SimpleCommunicationBehavior(Behavior specif, InstanceSpecification host, Dictionary<String,ValueSpecification> p)
     : base(specif, host,p)
 {
 }
Exemplo n.º 7
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;
 }
Exemplo n.º 8
0
 public AgentBehaviorExecution(Behavior specif, InstanceSpecification host, Dictionary<String, ValueSpecification> p)
     : base(specif, host, p, false)
 {
 }
Exemplo n.º 9
0
 public abstract BehaviorExecution InstanciateOpaqueBehavior(Behavior behavior, string typeName, InstanceSpecification host, Dictionary <string, ValueSpecification> p);
Exemplo n.º 10
0
 public Operation(string name, Class owner, Behavior behavior)
     : base(name, behavior)
 {
     this.classifier = owner;
     this.type = null;
 }
Exemplo n.º 11
0
 public CyclicBehaviorExecution(Behavior specif, InstanceSpecification host, Dictionary<String, ValueSpecification> p)
     : base(specif, host, p)
 {
 }
Exemplo n.º 12
0
 public BehavioralFeature(string name, Behavior behavior)
     : base(name)
 {
     method = behavior;
 }
Exemplo n.º 13
0
 // StreamWriter file = MascaretApplication.Instance.logfile;
 public ProceduralBehavior(Behavior behavior, InstanceSpecification host, Dictionary<String, ValueSpecification> p)
     : base(behavior, host, p)
 {
 }
Exemplo n.º 14
0
        public BehaviorExecution InstanciateOpaqueBehavior(Behavior behavior, string typeName, InstanceSpecification host, Dictionary<String, ValueSpecification> p)
        {
            //Assembly assembly = Assembly.GetExecutingAssembly();
            if (plugin != null)
            {
                Type type = plugin.GetType(typeName, true);

                BehaviorExecution be = null;
                if (type != null)
                    be = (BehaviorExecution)(Activator.CreateInstance(type));
                else
                    return MascaretApplication.Instance.VRComponentFactory.InstanciateOpaqueBehavior(behavior, typeName, host, p);

                if (be != null)
                    be.init(behavior, host, p, false);
                return be;
            }
            else return MascaretApplication.Instance.VRComponentFactory.InstanciateOpaqueBehavior(behavior, typeName, host, p);
        }
Exemplo n.º 15
0
 public ConversationalBehavior(Behavior specif, InstanceSpecification host, Dictionary<String, ValueSpecification> p)
     : base(specif, host, p)
 {
 }
 public abstract BehaviorExecution InstanciateOpaqueBehavior(Behavior behavior, string typeName, InstanceSpecification host, Dictionary<string, ValueSpecification> p);
 public SimpleCommunicationBehavior(Behavior specif, InstanceSpecification host, Dictionary <String, ValueSpecification> p) : base(specif, host, p)
 {
 }
Exemplo n.º 18
0
 public BehavioralFeature(string name, Behavior behavior)
     : base(name)
 {
     method = behavior;
 }
Exemplo n.º 19
0
        // StreamWriter file = MascaretApplication.Instance.logfile;


        public ProceduralBehavior(Behavior behavior, InstanceSpecification host, Dictionary <String, ValueSpecification> p)
            : base(behavior, host, p)
        {
        }