Esempio n. 1
0
        public bool InitialiseAgentUsingArchetype(PuppeteerAgent _agent, Guid _archetypeGuid)
        {
            if (_archetypeGuid == Guid.Empty)
            {
                PuppeteerLogger.Log(string.Format("Agent {0} has no Archetype configured.", _agent), LogType.Warning);
            }

            m_DescriptionCache.ArchetypeDesc = GetArchetypeDescription(_archetypeGuid);
            if (m_DescriptionCache.ArchetypeDesc == null)
            {
                PuppeteerLogger.Log(string.Format("Archetype with GUID [{0}] couldn't be loaded", _archetypeGuid.ToString()), LogType.Error);
                return(false);
            }

            _agent.ClearGoals();

            for (int i = 0; i < m_DescriptionCache.ArchetypeDesc.GoalGUIDs.Length; ++i)
            {
                m_DescriptionCache.GoalDesc = GetGoalDescription(m_DescriptionCache.ArchetypeDesc.GoalGUIDs[i]);

                if (m_DescriptionCache.GoalDesc != null)
                {
                    _agent.AddGoal(m_DescriptionCache.GoalDesc);
                }
            }

            _agent.ClearActions();

            for (int i = 0; i < m_DescriptionCache.ArchetypeDesc.ActionGUIDs.Length; ++i)
            {
                m_DescriptionCache.ActionDesc = GetActionDescription(m_DescriptionCache.ArchetypeDesc.ActionGUIDs[i]);

                if (m_DescriptionCache.ActionDesc != null)
                {
                    _agent.AddAction(m_DescriptionCache.ActionDesc);
                }
            }

            _agent.ClearSensors();

            for (int i = 0; i < m_DescriptionCache.ArchetypeDesc.SensorGUIDs.Length; ++i)
            {
                m_DescriptionCache.SensorDesc = GetSensorDescription(m_DescriptionCache.ArchetypeDesc.SensorGUIDs[i]);

                if (m_DescriptionCache.SensorDesc != null)
                {
                    _agent.AddSensor(m_DescriptionCache.SensorDesc);
                }
            }

            _agent.SortSensors();

            return(true);
        }
Esempio n. 2
0
 public virtual bool IsValid(PuppeteerAgent _executingAgent)
 {
     return(true);
 }
Esempio n. 3
0
 public virtual void Enter(PuppeteerAgent _executingAgent)
 {
     base.Enter(_executingAgent);
     m_Agent = _executingAgent;
 }
 public virtual void Initialise(PuppeteerAgent _owner)
 {
 }
 public virtual bool DetectWorldStateChange(PuppeteerAgent _owner)
 {
     return(false);
 }
Esempio n. 6
0
 public GoalPlanPair <string, object> GeneratePlanForAgent(PuppeteerAgent _agent)
 {
     return(m_Planner.GenerateGoalPlanPairForAgent(_agent));
 }
Esempio n. 7
0
 public void RegisterAgent(PuppeteerAgent _agent)
 {
     m_Agents.Add(_agent);
 }