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_ResourceStoredContainerStoragePartialHelper.c
Go to the documentation of this file.
1
class
SCR_ResourceStoredContainerStoragePartialHelper
2
{
3
protected
SCR_ResourceContainer
m_ContainerFrom
;
4
protected
SCR_ResourceContainer
m_ContainerToCached
;
5
protected
bool
m_bHasDetectedContainers
;
6
protected
float
m_fMaxStoredResourceValue
;
7
8
//------------------------------------------------------------------------------------------------
9
float
GetMaxStoredResourceValue
()
10
{
11
if
(
m_bHasDetectedContainers
)
12
return
Math
.Min(
m_fMaxStoredResourceValue
,
m_ContainerFrom
.GetResourceValue());
13
14
return
-1.0;
15
}
16
17
//------------------------------------------------------------------------------------------------
18
protected
bool
IsSourceValid
(notnull
IEntity
entity)
19
{
20
if
(entity ==
m_ContainerFrom
.GetOwner())
21
return
false
;
22
23
SCR_ResourceComponent component = SCR_ResourceComponent.Cast(entity.FindComponent(SCR_ResourceComponent));
24
25
if
(!component)
26
return
false
;
27
// TODO MARIO: Fix the whole method for the container query.
28
//m_ContainerToCached = component.GetContainer();
29
30
if
(!
m_ContainerToCached
)
31
return
false
;
32
33
if
(!
m_bHasDetectedContainers
&&
m_ContainerToCached
.IsAllowedToStoreResource())
34
m_bHasDetectedContainers
=
true
;
35
36
return
m_ContainerToCached
.CanStoreResource();
37
}
38
39
//------------------------------------------------------------------------------------------------
40
protected
bool
ProcessStorage
(notnull
IEntity
entity)
41
{
42
m_bHasDetectedContainers
=
true
;
43
m_fMaxStoredResourceValue
+=
m_ContainerToCached
.ComputeResourceDifference();
44
45
return
m_fMaxStoredResourceValue
<
m_ContainerFrom
.GetResourceValue();
46
}
47
48
//------------------------------------------------------------------------------------------------
49
void
SCR_ResourceStoredContainerStoragePartialHelper
(notnull
SCR_ResourceContainer
container)
50
{
51
m_ContainerFrom
= container;
52
}
53
};
IEntity
Definition
IEntity.c:13
Math
Definition
Math.c:13
SCR_ResourceContainer
Definition
SCR_ResourceContainer.c:35
SCR_ResourceStoredContainerStoragePartialHelper::m_ContainerToCached
SCR_ResourceContainer m_ContainerToCached
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:4
SCR_ResourceStoredContainerStoragePartialHelper::m_ContainerFrom
SCR_ResourceContainer m_ContainerFrom
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:3
SCR_ResourceStoredContainerStoragePartialHelper::ProcessStorage
bool ProcessStorage(notnull IEntity entity)
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:40
SCR_ResourceStoredContainerStoragePartialHelper::IsSourceValid
bool IsSourceValid(notnull IEntity entity)
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:18
SCR_ResourceStoredContainerStoragePartialHelper::m_bHasDetectedContainers
bool m_bHasDetectedContainers
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:5
SCR_ResourceStoredContainerStoragePartialHelper::GetMaxStoredResourceValue
float GetMaxStoredResourceValue()
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:9
SCR_ResourceStoredContainerStoragePartialHelper::m_fMaxStoredResourceValue
float m_fMaxStoredResourceValue
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:6
SCR_ResourceStoredContainerStoragePartialHelper::SCR_ResourceStoredContainerStoragePartialHelper
void SCR_ResourceStoredContainerStoragePartialHelper(notnull SCR_ResourceContainer container)
Definition
SCR_ResourceStoredContainerStoragePartialHelper.c:49
scripts
Game
Sandbox
Resources
Container
SCR_ResourceStoredContainerStoragePartialHelper.c
Generated by
1.17.0