3 protected ref array<AIAgent> m_aAgents = {};
4 protected ref array<SCR_AIInfoComponent> m_aInfoComponents = {};
6 protected bool m_bLocked =
false;
9 void AddMember(AIAgent agent, SCR_AIInfoComponent infoComponent)
11 m_aAgents.Insert(agent);
16 void RemoveMember(AIAgent agent)
18 int id = m_aAgents.Find(agent);
26 protected void RemoveMember(
int id, out AIAgent outAgent, out SCR_AIInfoComponent outInfoComp)
28 outAgent = m_aAgents[id];
36 void GetMember(
int id, out AIAgent outAgent, out SCR_AIInfoComponent outInfoComp)
38 if (!m_aAgents.IsIndexValid(
id))
41 outAgent = m_aAgents[id];
46 AIAgent GetMember(
int id)
48 if (!m_aAgents.IsIndexValid(
id))
55 IEntity GetFirstMemberEntity()
57 if (m_aAgents.IsEmpty())
59 foreach (AIAgent agent : m_aAgents)
63 IEntity controlledEntity = agent.GetControlledEntity();
64 return controlledEntity;
70 void GetMembers(notnull array<AIAgent> outAgents)
73 foreach (
auto a : m_aAgents)
86 count = Math.ClampInt(count, 0, otherFt.m_aAgents.Count());
89 for (
int i = 0; i < count; i++)
92 int lastId = otherFt.m_aAgents.Count() - 1;
94 SCR_AIInfoComponent infoComp;
95 otherFt.RemoveMember(lastId, agent, infoComp);
98 AddMember(agent, infoComp);
103 bool HasMember(AIAgent agent)
105 return m_aAgents.Find(agent) != -1;
111 return m_aAgents.Count();
116 void Internal_OnLockDestroyed()