You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
596 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Duality;
using Duality.Resources;
namespace Steering
{
internal class AgentManager
{
private static AgentManager instance = null;
public static AgentManager Instance
{
get
{
if (instance == null) instance = new AgentManager();
return instance;
}
}
public IEnumerable<Agent> FindNeighborAgents(Agent referenceAgent)
{
// ToDo: Performance Optimization when necessary.
return Scene.Current.FindComponents<Agent>().Where(a => a != referenceAgent);
}
}
}