18 _parentManager(parentManager)
31 for (TeamMap::value_type& entity :
_team) {
41 _aiTeamCrowd[radius] = std::make_unique<Navigation::DivideDtCrowd>(navMesh);
45 const AITeamCrowd::iterator it =
_aiTeamCrowd.find(radius);
48 "AITeam error: DtCrowd does not exist for specified navmesh!");
58 for (
const TeamMap::value_type& entity :
_team) {
59 entities[i++] = entity.second;
70 it.second->update(deltaTimeUS);
80 const U16 entityCount =
to_U16(entities.size());
81 if (entityCount <= g_entityThreadedThreashold) {
91 Parallel_For( parentPool, descriptor, [deltaTimeUS, &entities](
const Task*,
const U32 start,
const U32 end)
93 for (
U32 i = start; i < end; ++i) {
106 const U16 entityCount =
to_U16(entities.size());
107 if (entityCount <= g_entityThreadedThreashold) {
117 Parallel_For( parentPool, descriptor, [deltaTimeUS, &entities](
const Task*,
const U32 start,
const U32 end)
119 for (
U32 i = start; i < end; ++i) {
133 const U16 entityCount =
to_U16(entities.size());
134 if (entityCount <= g_entityThreadedThreashold) {
144 Parallel_For( parentPool, descriptor, [deltaTimeUS, &entities](
const Task*,
const U32 start,
const U32 end)
146 for (
U32 i = start; i < end; ++i) {
160 entity->resetCrowd();
bool removeEnemyTeam(U32 enemyTeamID)
void removeCrowd(AIEntity::PresetAgentRadius radius)
void resetCrowd()
Update the crowding system.
bool removeTeamMember(AIEntity *entity)
vector< AIEntity * > getEntityList() const
AITeam(U32 id, AIManager &parentManager)
bool addTeamMember(AIEntity *entity)
void addCrowd(AIEntity::PresetAgentRadius radius, Navigation::NavigationMesh *navMesh)
bool processInput(TaskPool &parentPool, U64 deltaTimeUS)
vector< U32 >::iterator findEnemyTeamEntry(U32 enemyTeamID)
bool addEnemyTeam(U32 enemyTeamID)
bool update(TaskPool &parentPool, U64 deltaTimeUS)
vector< U32 > _enemyTeams
bool processData(TaskPool &parentPool, U64 deltaTimeUS)
static bool update(AIEntity &entity, const U64 deltaTimeUS)
static void setTeamPtr(AIEntity &entity, AITeam *const teamPtr)
static bool processInput(AIEntity &entity, const U64 deltaTimeUS)
static bool processData(AIEntity &entity, const U64 deltaTimeUS)
Utility class that adds basic GUID management to objects.
FORCE_INLINE I64 getGUID() const noexcept
constexpr U16 g_entityThreadedThreashold
std::lock_guard< mutex > LockGuard
void insert(eastl::vector< T, A1 > &target, const eastl::vector< T, A2 > &source)
constexpr U16 to_U16(const T value)
eastl::vector< Type > vector
std::shared_lock< mutex > SharedLock
void Parallel_For(TaskPool &pool, const ParallelForDescriptor &descriptor, const DELEGATE< void, const Task *, U32, U32 > &cbk)
U32 _partitionSize
How many elements should we process per async task.
U32 _iterCount
For loop iteration count.