Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_ResourceGeneratorActionStore.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_ResourceGeneratorActionStore
:
SCR_ResourceGeneratorActionBase
3
{
4
//------------------------------------------------------------------------------------------------
5
override
float
ComputeGeneratedResources(notnull
SCR_ResourceGenerator
generator,
float
resourceValue)
6
{
7
return
Math
.Min(resourceValue, generator.GetAggregatedMaxResourceValue() - generator.GetAggregatedResourceValue());
8
}
9
10
//------------------------------------------------------------------------------------------------
11
override
void
PerformAction
(notnull
SCR_ResourceGenerator
generator, inout
float
resourceValue)
12
{
13
SCR_ResourceContainer
containerTo;
14
SCR_ResourceContainerQueueBase
containerQueue = generator.GetContainerQueue();
15
int
containerCount = containerQueue.
GetContainerCount
();
16
17
for
(
int
i = 0; i < containerCount; i++)
18
{
19
if
(resourceValue <= 0)
20
break
;
21
22
containerTo = containerQueue.
GetContainerAt
(i);
23
24
if
(!containerTo)
25
continue
;
26
27
float
usedResources =
Math
.Min(containerTo.
ComputeResourceDifference
(), resourceValue);
28
resourceValue -= usedResources;
29
30
containerTo.
IncreaseResourceValue
(usedResources);
31
}
32
}
33
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
Math
Definition
Math.c:13
SCR_ResourceContainer
Definition
SCR_ResourceContainer.c:35
SCR_ResourceContainer::ComputeResourceDifference
float ComputeResourceDifference()
Definition
SCR_ResourceContainer.c:724
SCR_ResourceContainer::IncreaseResourceValue
bool IncreaseResourceValue(float value, bool notifyChange=true)
Definition
SCR_ResourceContainer.c:529
SCR_ResourceContainerQueueBase
Definition
SCR_ResourceContainerQueue.c:3
SCR_ResourceContainerQueueBase::GetContainerAt
SCR_ResourceContainer GetContainerAt(int index)
Definition
SCR_ResourceContainerQueue.c:131
SCR_ResourceContainerQueueBase::GetContainerCount
int GetContainerCount()
Definition
SCR_ResourceContainerQueue.c:176
SCR_ResourceGeneratorActionBase
Definition
SCR_ResourceGeneratorActionBase.c:3
SCR_ResourceGeneratorActionStore
Definition
SCR_ResourceGeneratorActionStore.c:3
SCR_ResourceGenerator
Definition
SCR_ResourceGenerator.c:80
PerformAction
@ PerformAction
Definition
EUserActionEvent.c:15
scripts
Game
Sandbox
Resources
Generator
Actions
SCR_ResourceGeneratorActionStore.c
Generated by
1.17.0