Esempio n. 1
0
 /// <summary>
 /// Picks the given action from the given agent.
 ///
 /// The method uses the agent's behaviour dictionary to get the
 /// action method.
 ///
 /// The log domain is set to "[AgentId].Action.[action_name]".
 ///
 /// The action name is set to "[BehaviourName].[action_name]".
 /// </summary>
 /// <param name="agent">The agent that can perform the action.</param>
 /// <param name="actionName">The name of the action</param>
 public POSHAction(Agent agent, string actionName)
     : base(string.Format("Action.{0}", actionName), agent)
 {
     behaviourDict = agent.getBehaviourDict();
     action        = behaviourDict.getAction(actionName);
     behaviour     = behaviourDict.getActionBehaviour(actionName);
     name          = string.Format("{0}.{1}", behaviour.GetName(), actionName);
     log.Debug("Created");
 }
Esempio n. 2
0
 /// <summary>
 /// Picks the given action from the given agent.
 /// 
 /// The method uses the agent's behaviour dictionary to get the
 /// action method.
 /// 
 /// The log domain is set to "[AgentId].Action.[action_name]".
 /// 
 /// The action name is set to "[BehaviourName].[action_name]".
 /// </summary>
 /// <param name="agent">The agent that can perform the action.</param>
 /// <param name="actionName">The name of the action</param>
 public POSHAction(Agent agent, string actionName)
     : base(string.Format("Action.{0}",actionName),agent)
 {
     behaviourDict = agent.getBehaviourDict();
     action = behaviourDict.getAction(actionName);
     behaviour = behaviourDict.getActionBehaviour(actionName);
     name = string.Format("{0}.{1}",behaviour.GetName(),actionName);
     log.Debug("Created");
 }
Esempio n. 3
0
        /// <summary>
        /// Picks the given action from the given agent.
        /// 
        /// The method uses the agent's behaviour dictionary to get the
        /// action method.
        /// 
        /// The log domain is set to "[AgentId].Action.[action_name]".
        /// 
        /// The action name is set to "[BehaviourName].[action_name]".
        /// </summary>
        /// <param name="agent">The agent that can perform the action.</param>
        /// <param name="actionName">The name of the action</param>
        public POSHAction(Agent agent, string actionName)
            : base(string.Format("Action.{0}",actionName),agent)
        {
            behaviourDict = agent.getBehaviourDict();
            action = behaviourDict.getAction(actionName);
            behaviour = behaviourDict.getActionBehaviour(actionName);
            name = string.Format("{0}.{1}",behaviour.GetName(),actionName);
            log.Debug("Created");

            //hook up to a listener for fire events
            if (agent.HasListenerForTyp(EventType.Fire))
                agent.SubscribeToListeners(this, EventType.Fire);
        }
Esempio n. 4
0
        /// <summary>
        /// Picks the given action from the given agent.
        ///
        /// The method uses the agent's behaviour dictionary to get the
        /// action method.
        ///
        /// The log domain is set to "[AgentId].Action.[action_name]".
        ///
        /// The action name is set to "[BehaviourName].[action_name]".
        /// </summary>
        /// <param name="agent">The agent that can perform the action.</param>
        /// <param name="actionName">The name of the action</param>
        public POSHAction(Agent agent, string actionName)
            : base(string.Format("Action.{0}", actionName), agent)
        {
            behaviourDict = agent.getBehaviourDict();
            action        = behaviourDict.getAction(actionName);
            behaviour     = behaviourDict.getActionBehaviour(actionName);
            name          = string.Format("{0}.{1}", behaviour.GetName(), actionName);
            log.Debug("Created");

            //hook up to a listener for fire events
            if (agent.HasListenerForTyp(EventType.Fire))
            {
                agent.SubscribeToListeners(this, EventType.Fire);
            }
        }