7 [
Attribute(
"5",
desc:
"How often will the Supplies transport system be updated [s].",
params:
"0 100 0.1")]
8 protected float m_fUpdateInterval;
12 protected ref set<SCR_TransportUnitComponent>
m_TransportUnits =
new set<SCR_TransportUnitComponent>();
65 transportUnits.Clear();
69 if (transportUnit.GetFaction() == faction)
71 transportUnits.Insert(transportUnit);
116 if (transportUnit == ignoredTransportUnit)
135 if (transportUnit == ignoredTransportUnit)
138 if (transportUnit.GetVehicle() == vehicle)
154 if (transportUnit == ignoredTransportUnit)
157 if (transportUnit.GetVehicle() != vehicle)
176 if (transportUnit == ignoredTransportUnit)
189 float timeSlice = args.GetTimeSliceSeconds();
202 transportUnit.Update(timeSlice);
209 transportUnit.ReturnToSourceBaseIfNeeded();
219 if (transportUnit.IsReadyForTaskSolving())
221 SCR_ResupplyCampaignMilitaryBaseTaskEntity
task = transportUnit.GetPreferableResupplyTask();
228 units.Insert(transportUnit);
233 units.Insert(transportUnit);
243 float minSqDistance =
float.MAX;
247 float sqDistance =
vector.DistanceSqXZ(
task.GetOrigin(), transportUnit.GetOwner().GetOrigin());
248 if (sqDistance < minSqDistance)
250 minSqDistance = sqDistance;
251 closestTransportUnit = transportUnit;
255 if (closestTransportUnit)
283 override protected void OnDiag(
float timeSlice)
285 super.OnDiag(timeslice);
293 DbgUI.Begin(
"SCR_SuppliesTransportSystem", 0, 100);
295 string time =
SCR_FormatHelper.FormatTime(GetWorld().GetWorldTime() * 0.001);
296 DbgUI.Text(
string.Format(
"Time: %1.", time));
302 string sourceBaseName =
"None";
305 sourceBaseName =
base.GetCallsignDisplayNameOnly();
310 string solverState =
"No Solver";
311 string resupplySolverState = solverState;
318 string preferableTaskName =
"None";
319 SCR_ResupplyCampaignMilitaryBaseTaskEntity resupplyTask = transportUnit.GetPreferableResupplyTask();
325 preferableTaskName =
string.Format(
"Resupply %1 (%2)", suppliedBase.
GetBaseNameUpperCase(), suppliedBase.GetCallsignDisplayNameOnlyUC());
329 string transportUnitName = transportUnit.GetName();
332 if (transportUnitName.StartsWith(
"#"))
333 transportUnitName = transportUnitName.Substring(1, transportUnitName.Length() - 1);
335 DbgUI.Text(
string.Format(
"%1 - state: %2, usable vehicle: %3, source base: %4, prefered task: %5, solver state: %6, resupply solver state: %7",
336 transportUnitName, transportUnitState, transportUnit.IsVehicleUsable(), sourceBaseName, preferableTaskName, solverState,
337 resupplySolverState));
339 Vehicle vehicle = transportUnit.GetVehicle();
343 int lineColor =
Color.DODGER_BLUE;
345 lineColor =
Color.SPRING_GREEN;
ArmaReforgerScripted GetGame()
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
SCR_EResupplyTaskSolverState
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
ScriptInvokerBase< OnTransportUnitChangedDelegate > OnTransportUnitChangedInvoker
func OnTransportUnitChangedDelegate
void SCR_Task(IEntitySource src, IEntity parent)
string GetBaseNameUpperCase()
Returns the upper-case name of this base.
SCR_EResupplyTaskSolverState GetResupplyTaskSolverState()
ref OnTransportUnitChangedInvoker m_OnTransportUnitRemoved
set< SCR_TransportUnitComponent > GetTransportUnits()
void OnDiag(float timeSlice)
OnTransportUnitChangedInvoker GetOnTransportUnitRemoved()
void PopulateResupplyTaskToTransportUnitsMap()
bool IsTaskSolved(SCR_Task task, SCR_TransportUnitComponent ignoredTransportUnit=null)
ref OnTransportUnitChangedInvoker m_OnTransportUnitAdded
bool Register(notnull SCR_TransportUnitComponent transportUnit)
ref map< SCR_ResupplyCampaignMilitaryBaseTaskEntity, ref array< SCR_TransportUnitComponent > > m_mResupplyTaskToTransportUnitsMap
OnTransportUnitChangedInvoker GetOnTransportUnitAdded()
void StartSolvingTaskByClosestUnit(SCR_ResupplyCampaignMilitaryBaseTaskEntity task, array< SCR_TransportUnitComponent > units)
bool IsVehicleSelected(Vehicle vehicle, SCR_TransportUnitComponent ignoredTransportUnit=null)
bool Unregister(notnull SCR_TransportUnitComponent transportUnit)
bool IsVehicleBoarded(Vehicle vehicle, SCR_TransportUnitComponent ignoredTransportUnit=null)
static SCR_SuppliesTransportSystem GetInstance()
ref set< SCR_TransportUnitComponent > m_TransportUnits
bool IsVehicleUsed(Vehicle vehicle, SCR_TransportUnitComponent ignoredTransportUnit=null)
static override void InitInfo(WorldSystemInfo outInfo)
void EvaluateTransportUnits()
void OnUpdatePoint(WorldUpdatePointArgs args)
int GetTransportUnits(out notnull array< SCR_TransportUnitComponent > transportUnits, Faction faction)
void SelectForTaskSolving(SCR_ResupplyCampaignMilitaryBaseTaskEntity task)
Instance of created debug visualizer.
Structure holding world system meta-information required by the engine.
Structure holding extra data of WorldSystem update point.
enum EPhysicsLayerPresets Vehicle
WorldSystemPoint ESystemPoint
BaseRplComponentClass GenericComponentClass GetNode()
SCR_FieldOfViewSettings Attribute
RplRole
Role of replicated node (and all items in it) within the replication system.