87 [
Attribute(uiwidget:
UIWidgets.SpinBox,
desc:
"Sets the range in meters on which the stored resource looks for a Storage point to merge with.",
params:
"0.0 10000.0 1.0")]
97 protected ref array<ref SCR_ResourceGeneratorActionBase>
m_aActions;
120 return m_eIdentifier;
127 return m_fAggregatedResourceValue;
136 return m_fAggregatedMaxResourceValue;
172 return super.FindContainer(container);
184 OnContainerRegistered(container);
197 OnContainerRegistered(container);
220 GetGame().GetResourceGrid().UpdateInteractor(
this);
233 resourceAmount -= action.ComputeGeneratedResources(
this, resourceAmount);
235 if (resourceAmount <= 0)
258 if (resourceAmount <= 0)
261 action.PerformAction(
this, resourceAmount);
276 vector origin = GetOwnerOrigin();
285 DebugTextWorldSpace.Create(
GetGame().GetWorld(),
string.Format(
" %1 \n %2 containers \n %3 / %4 resources \n %5 m ", m_sDebugName,
GetContainerCount(),
GetAggregatedResourceValue(),
GetAggregatedMaxResourceValue(),
m_fStorageRange),
DebugTextFlags.ONCE |
DebugTextFlags.CENTER |
DebugTextFlags.FACE_CAMERA, origin[0], origin[1] +
m_fStorageRange, origin[2], 10.0, color.PackToInt(), color2.PackToInt());
302 OnMaxResourcesChanged(
310 super.Initialize(owner);
332 GetGame().GetResourceSystemSubscriptionManager().OnResourceInteractorDeleted(
this);
340 return snapshot.Compare(componentRplId, 4)
342 && snapshot.Compare(m_fAggregatedResourceValue, 4)
343 && snapshot.Compare(m_fAggregatedMaxResourceValue, 4)
345 && snapshot.Compare(m_eResourceRights, 4)
347 && snapshot.Compare(m_eIdentifier, 4);
357 snapshot.SerializeBytes(componentRplId, 4);
359 snapshot.SerializeBytes(aggregatedResourceValue, 4);
360 snapshot.SerializeBytes(aggregatedMaxResourceValue, 4);
362 snapshot.SerializeBytes(m_eResourceRights, 4);
364 snapshot.SerializeBytes(m_eIdentifier, 4);
373 RplId componentRplId;
375 snapshot.SerializeBytes(componentRplId, 4);
377 snapshot.SerializeBytes(m_fAggregatedResourceValue, 4);
378 snapshot.SerializeBytes(m_fAggregatedMaxResourceValue, 4);
380 snapshot.SerializeBytes(m_eResourceRights, 4);
382 snapshot.SerializeBytes(m_eIdentifier, 4);
ArmaReforgerScripted GetGame()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EResourceType m_eResourceType
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void OnResourcesChanged(SCR_ResourceInteractor interactor, float previousSupplies)
SCR_ResourceComponent m_ResourceComponent
Replication item identifier.
float GetMaxResourceValue()
float GetAvailableResourceSpace()
void SetReason(EResourceReason reasonCode)
EResourceReason m_eReason
float m_fAvailableResourceSpace
void SetResourceMultiplier(float resourceMultiplier)
void SCR_ResourceGenerationResponse(float availableResourceSpace=0, float resourceMultiplier=0, float range=0, EResourceReason reasonCode=EResourceReason.UNAVAILABLE)
float m_fResourceMultiplier
EResourceReason GetReason()
float GetResourceMultiplier()
void SetRange(float range)
void SetAvailableResourceSpace(float availableResourceSpace)
override float GetResourceGridRange()
override float GetAggregatedResourceValue()
override bool CanInteractWith(notnull SCR_ResourceContainer container)
override int GetContainerCount()
float m_fResourceMultiplier
static bool Extract(SCR_ResourceGenerator instance, ScriptCtx ctx, SSnapSerializerBase snapshot)
override bool UnregisterContainer(int containerIndex)
static bool PropCompare(SCR_ResourceGenerator instance, SSnapSerializerBase snapshot, ScriptCtx ctx)
override bool RegisterContainer(notnull SCR_ResourceContainer container)
override bool UnregisterContainer(notnull SCR_ResourceContainer container)
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
override void UpdateContainerResourceValue(SCR_ResourceContainer container, float previousValue)
override void UpdateContainerMaxResourceValue(SCR_ResourceContainer container, float previousValue)
override bool RegisterContainerForced(notnull SCR_ResourceContainer container)
bool InjectNetworkedVariables(SSnapSerializerBase snapshot, ScriptCtx hint)
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_ResourceGenerator instance)
static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
bool ExtractNetworkedVariables(SSnapSerializerBase snapshot, ScriptCtx hint)
ref array< ref SCR_ResourceGeneratorActionBase > m_aActions
override void Initialize(notnull IEntity owner)
ref SCR_ResourceGeneratorContainerQueue m_ContainerQueue
override int FindContainer(notnull SCR_ResourceContainer container)
override SCR_ResourceContainerQueueBase GetContainerQueue()
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
SCR_ResourceGenerationResponse RequestAvailability(float resourceAmount)
SCR_ResourceGenerationResponse RequestGeneration(float resourceAmount, SCR_ResourceGenerator generator=null)
bool PropCompareNetworkedVariables(SSnapSerializerBase snapshot, ScriptCtx hint)
override float GetAggregatedMaxResourceValue()
float GetResourceMultiplier()
override EResourceGeneratorID GetIdentifier()
Instance of created debug visualizer.
@ DEFAULT
Use currently set main RT format (based on game options).
SCR_FieldOfViewSettings Attribute
@ INVALID
Missing components, or obstruction test was not possible.