Exemplo n.º 1
0
        public DtCrowdAgent GetAgent(int idx)
        {
            DtCrowdAgent result = default;

            Navigation.Crowd.GetAgent(DtCrowd, idx, new IntPtr(&result));
            return(result);
        }
Exemplo n.º 2
0
        public int GetAgents(List <DtCrowdAgent> agents, int max)
        {
            DtCrowdAgentsResult result = default;

            DtCrowdAgent[] generatedAgents = new DtCrowdAgent[max];
            fixed(DtCrowdAgent *agentsPtr = generatedAgents)
            {
                result.Agents = new IntPtr(agentsPtr);
                Navigation.Crowd.GetAgents(DtCrowd, new IntPtr(&result));
            }

            DtCrowdAgent *resultAgents = (DtCrowdAgent *)result.Agents;

            for (int i = 0; i < result.AgentCount; i++)
            {
                agents.Add(resultAgents[i]);
            }
            return(result.AgentCount);
        }