6 protected ref map<int, ref SCR_CallsignPlatoonData> m_mPlatoonCallsigns =
new map<int, ref SCR_CallsignPlatoonData>;
15 array<ref SCR_CallsignInfo> platoonArray =
new array<ref SCR_CallsignInfo>;
16 factionCallsignInfo.GetPlatoonArray(platoonArray);
17 int count = platoonArray.Count();
19 for(
int i = 0; i < count; i++)
22 platoonData.Init(factionCallsignInfo);
23 m_mPlatoonCallsigns.Insert(i, platoonData);
34 void GetRandomCallsign(out
int platoon, out
int squad)
37 int random = Math.RandomInt(0, m_mPlatoonCallsigns.Count());
38 platoon = m_mPlatoonCallsigns.GetKey(random);
41 squad = randomPlatoon.GetRandomSquad();
51 void GetFirstAvailibleCallsign(out
int firstAvailiblePlatoon, out
int firstAvailibleSquad)
53 firstAvailiblePlatoon =
int.MAX;
58 if (
index < firstAvailiblePlatoon)
60 firstAvailiblePlatoon =
index;
61 firstAvailiblePlatoonData = platoon;
65 firstAvailibleSquad = firstAvailiblePlatoonData.GetFirstAvailibleSquad();
74 void AddCallsign(
int platoonIndex,
int squadIndex)
78 if (m_mPlatoonCallsigns.Find(platoonIndex, platoonData))
80 platoonData.AddSquad(squadIndex);
85 platoonData.AddSquad(squadIndex);
86 m_mPlatoonCallsigns.Insert(platoonIndex, platoonData);
96 bool RemoveCallsign(
int plattonIndex,
int squadIndex)
100 if (m_mPlatoonCallsigns.Find(plattonIndex, platoonData))
103 if (platoonData.RemoveSquad(squadIndex))
105 m_mPlatoonCallsigns.Remove(plattonIndex);
106 return m_mPlatoonCallsigns.IsEmpty();