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_ResourceSystemSubscriptionHandleBase.c
Go to the documentation of this file.
1
class
SCR_ResourceSystemSubscriptionHandleBase
2
{
3
protected
RplId
m_OwnerRplId
;
4
protected
RplId
m_ResourceComponentRplId
;
5
protected
typename
m_InteractorType
;
6
protected
EResourceType
m_eResourceType
;
7
protected
EResourceGeneratorID
m_eResourceIdentifier
;
8
protected
SCR_ResourceSystemSubscriptionManager
m_SubscriptionManager
;
9
protected
WorldTimestamp
m_fLastPokedAt
;
10
11
//------------------------------------------------------------------------------------------------
12
static
SCR_ResourceSystemSubscriptionHandleBase
CreateHandle
(notnull
SCR_ResourceSystemSubscriptionManager
manager,
RplId
ownerRplId,
RplId
resourceComponentRplId,
typename
interactorType,
EResourceType
resourceType,
EResourceGeneratorID
resourceIdentifier)
13
{
14
Managed owner =
Replication
.FindItem(ownerRplId);
15
16
if
(!owner)
17
return
null;
18
19
SCR_ResourceSystemSubscriptionHandleBase
handle = manager.GetHandle(resourceComponentRplId, interactorType, resourceType, resourceIdentifier);
20
21
if
(handle)
22
return
handle;
23
24
string
stringType =
string
.Format(
"SCR_ResourceSystemSubscriptionHandle<%1>"
, owner.Type());
25
typename
type
= stringType.ToType();
26
handle =
SCR_ResourceSystemSubscriptionHandleBase
.Cast(
type
.Spawn());
27
28
if
(!handle)
29
return
null;
30
31
handle.
OnInit
(manager, ownerRplId, resourceComponentRplId, interactorType, resourceType, resourceIdentifier);
32
33
return
handle;
34
}
35
36
//------------------------------------------------------------------------------------------------
37
WorldTimestamp
GetLastPokedAt
()
38
{
39
return
m_fLastPokedAt
;
40
}
41
42
//------------------------------------------------------------------------------------------------
43
RplId
GetOwnerRplId
()
44
{
45
return
m_OwnerRplId
;
46
}
47
48
//------------------------------------------------------------------------------------------------
49
RplId
GetResourceComponentRplId
()
50
{
51
return
m_ResourceComponentRplId
;
52
}
53
54
//------------------------------------------------------------------------------------------------
55
typename
GetInteractorType
()
56
{
57
return
m_InteractorType
;
58
}
59
60
//------------------------------------------------------------------------------------------------
61
EResourceGeneratorID
GetResourceIdentifier
()
62
{
63
return
m_eResourceIdentifier
;
64
}
65
66
//------------------------------------------------------------------------------------------------
67
EResourceType
GetResourceType
()
68
{
69
return
m_eResourceType
;
70
}
71
72
//------------------------------------------------------------------------------------------------
73
void
Poke
()
74
{
75
m_fLastPokedAt
=
GetGame
().GetWorld().GetTimestamp();
76
}
77
78
//------------------------------------------------------------------------------------------------
79
protected
void
OnDelete
()
80
{
81
if
(
m_SubscriptionManager
)
82
m_SubscriptionManager
.OnSubscriptionListenerHandleDeleted(
this
);
83
}
84
85
//------------------------------------------------------------------------------------------------
86
protected
void
OnInit
(notnull
SCR_ResourceSystemSubscriptionManager
manager,
RplId
ownerRplId,
RplId
resourceComponentRplId,
typename
interactorType,
EResourceType
resourceType,
EResourceGeneratorID
resourceIdentifier)
87
{
88
m_SubscriptionManager
= manager;
89
m_OwnerRplId
= ownerRplId;
90
m_ResourceComponentRplId
= resourceComponentRplId;
91
m_InteractorType
= interactorType;
92
m_eResourceType
= resourceType;
93
m_eResourceIdentifier
= resourceIdentifier;
94
}
95
96
//------------------------------------------------------------------------------------------------
97
sealed
void
SCR_ResourceSystemSubscriptionHandleBase
(
SCR_ResourceSystemSubscriptionManager
manager,
RplId
ownerRplId,
RplId
resourceComponentRplId,
typename
interactorType,
EResourceType
resourceType,
EResourceGeneratorID
resourceIdentifier)
98
{
99
if
(manager)
100
OnInit
(manager, ownerRplId, resourceComponentRplId, interactorType, resourceType, resourceIdentifier);
101
}
102
103
//------------------------------------------------------------------------------------------------
104
sealed
void
~SCR_ResourceSystemSubscriptionHandleBase
()
105
{
106
OnDelete
();
107
}
108
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
type
EDamageType type
Definition
SCR_DestructibleTreeV2.c:32
EResourceType
EResourceType
Definition
SCR_ResourceContainer.c:2
EResourceGeneratorID
EResourceGeneratorID
Definition
SCR_ResourceGenerator.c:2
Replication
Main replication API.
Definition
Replication.c:14
RplId
Replication item identifier.
Definition
RplId.c:14
SCR_ResourceSystemSubscriptionHandleBase::OnDelete
void OnDelete()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:79
SCR_ResourceSystemSubscriptionHandleBase::CreateHandle
static SCR_ResourceSystemSubscriptionHandleBase CreateHandle(notnull SCR_ResourceSystemSubscriptionManager manager, RplId ownerRplId, RplId resourceComponentRplId, typename interactorType, EResourceType resourceType, EResourceGeneratorID resourceIdentifier)
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:12
SCR_ResourceSystemSubscriptionHandleBase::GetLastPokedAt
WorldTimestamp GetLastPokedAt()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:37
SCR_ResourceSystemSubscriptionHandleBase::m_eResourceIdentifier
EResourceGeneratorID m_eResourceIdentifier
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:7
SCR_ResourceSystemSubscriptionHandleBase::SCR_ResourceSystemSubscriptionHandleBase
sealed void SCR_ResourceSystemSubscriptionHandleBase(SCR_ResourceSystemSubscriptionManager manager, RplId ownerRplId, RplId resourceComponentRplId, typename interactorType, EResourceType resourceType, EResourceGeneratorID resourceIdentifier)
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:97
SCR_ResourceSystemSubscriptionHandleBase::GetResourceComponentRplId
RplId GetResourceComponentRplId()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:49
SCR_ResourceSystemSubscriptionHandleBase::m_fLastPokedAt
WorldTimestamp m_fLastPokedAt
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:9
SCR_ResourceSystemSubscriptionHandleBase::Poke
void Poke()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:73
SCR_ResourceSystemSubscriptionHandleBase::m_ResourceComponentRplId
RplId m_ResourceComponentRplId
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:4
SCR_ResourceSystemSubscriptionHandleBase::m_SubscriptionManager
SCR_ResourceSystemSubscriptionManager m_SubscriptionManager
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:8
SCR_ResourceSystemSubscriptionHandleBase::m_eResourceType
EResourceType m_eResourceType
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:6
SCR_ResourceSystemSubscriptionHandleBase::GetOwnerRplId
RplId GetOwnerRplId()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:43
SCR_ResourceSystemSubscriptionHandleBase::m_OwnerRplId
RplId m_OwnerRplId
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:3
SCR_ResourceSystemSubscriptionHandleBase::GetResourceType
EResourceType GetResourceType()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:67
SCR_ResourceSystemSubscriptionHandleBase::OnInit
void OnInit(notnull SCR_ResourceSystemSubscriptionManager manager, RplId ownerRplId, RplId resourceComponentRplId, typename interactorType, EResourceType resourceType, EResourceGeneratorID resourceIdentifier)
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:86
SCR_ResourceSystemSubscriptionHandleBase::~SCR_ResourceSystemSubscriptionHandleBase
sealed void ~SCR_ResourceSystemSubscriptionHandleBase()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:104
SCR_ResourceSystemSubscriptionHandleBase::m_InteractorType
m_InteractorType
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:5
SCR_ResourceSystemSubscriptionHandleBase::GetResourceIdentifier
EResourceGeneratorID GetResourceIdentifier()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:61
SCR_ResourceSystemSubscriptionHandleBase::GetInteractorType
GetInteractorType()
Definition
SCR_ResourceSystemSubscriptionHandleBase.c:55
SCR_ResourceSystemSubscriptionManager
Definition
SCR_ResourceSystemSubscriptionManager.c:2
WorldTimestamp
Definition
WorldTimestamp.c:26
OnInit
@ OnInit
Definition
SndComponentCallbacks.c:17
scripts
Game
Sandbox
Resources
Subscription
Handler
SCR_ResourceSystemSubscriptionHandleBase.c
Generated by
1.17.0