/// <summary>
 /// Creates a new edge for use with an AgentAgencyList
 /// </summary>
 /// <param name="entity">The entity that the adjacency list is tracking.</param>
 /// <param name="distance">The distance this entity is from the owner entity of the list.</param>
 /// <param name="angle">The angle, in relation to the owner's heading that this entity is.</param>
 public AgentAdjacencyListEdge(GameEntity entity, float distance, float angle)
 {
     m_Entity = entity;
     m_Distance = distance;
     m_Angle = angle;
     m_Angle = MathHelper.WrapAngle(m_Angle);
     if (m_Angle < 0)
         m_Angle += MathHelper.TwoPi;
 }
        /// <summary>
        /// Creates a new edge with null and 0 values
        /// </summary>
        public AgentAdjacencyListEdge()
        {
            //init fields
            m_Entity = null;

            m_Distance = 0;

            m_Angle = 0;
        }
Exemple #3
0
        public Map(ContentManager content, String filename)
        {
            //set content
            m_Content = content;

            //init lists
            InitializeLists();

            //load player
            m_Player = new Agent(this, m_NextId++, false);
            ((Agent)m_Player).LoadContent(content, "agent1");
            m_Player.IsActive = true;
            ((Agent)m_Player).SetPosition(Vector3.Zero);

            m_StartAgentLocation = new Vector3(0, 10, 0);

            //target
            m_SingleTargetAgent = new Agent(this, m_NextId++, false);
            m_SingleTargetAgent.Model = Content.Load<Model>("agent_target1");

            //other players

            //init ground
            m_Ground = new GameEntity();
            m_Ground.Model = Content.Load<Model>("floor");

            //init cam
            m_WorldCamera = new Camera();

            //init parameters
            m_Parameters = new Params("Params.ini");

            //Load the map file
            LoadNewMap(filename);

            m_SenseBombs = true;
            m_SenseAgents = true;
        }