DayZ 1.24
Loading...
Searching...
No Matches
WeaponEventBase Class Reference

signalize mechanism manipulation More...

Collaboration diagram for WeaponEventBase:
[legend]

Private Member Functions

void WeaponEventBase (DayZPlayer p=NULL, Magazine m=NULL)
 
WeaponEventID GetEventID ()
 returns id from enum WeaponEventID
 
WeaponEvents GetAnimEvent ()
 returns animation event from anim engine,
 
int GetPackedType ()
 returns eventID in upper 16 bits and AnimEvent in lower 16 bits
 
void ReadFromContext (ParamsReadContext ctx)
 
void WriteToContext (ParamsWriteContext ctx)
 
string DumpToString ()
 
void WeaponEventMechanism (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventTrigger (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventTriggerToJam (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventTriggerAutoStart (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventTriggerAutoEnd (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventLoad1Bullet (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventContinuousLoadBulletStart (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventContinuousLoadBulletEnd (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventUnjam (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventAttachMagazine (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventUnjammingFailedTimeout (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventUnjammingTimeout (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventDetachMagazine (DayZPlayer p=NULL, Magazine m=NULL, InventoryLocation il=NULL)
 
override void ReadFromContext (ParamsReadContext ctx)
 
override void WriteToContext (ParamsWriteContext ctx)
 
void WeaponEventSwapMagazine (DayZPlayer p=NULL, Magazine m=NULL, InventoryLocation il=NULL)
 
override void ReadFromContext (ParamsReadContext ctx)
 
override void WriteToContext (ParamsWriteContext ctx)
 
void WeaponEventHumanCommandActionFinished (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventHumanCommandActionAborted (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventReloadTimeout (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventDryFireTimeout (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventSetNextMuzzleMode (DayZPlayer p=NULL, Magazine m=NULL)
 
void WeaponEventAnimation (DayZPlayer p=NULL, Magazine m=NULL)
 animation event from Human.WeaponEvents
 
override int GetAnimEvent ()
 

Private Attributes

int m_eventID
 
DayZPlayer m_player
 
Magazine m_magazine
 
ref InventoryLocation m_dst
 
WeaponEvents m_type
 

Detailed Description

signalize mechanism manipulation

represents event that triggers transition from state to state

triggered when dry fire timer expires

triggered when reload timer expires

triggered when animation action aborts

triggered when animation action finishes

event when user wants to swap magazine

event when user wants to detach magazine

triggered when unjamming failed timer expires

triggered when unjamming timer expires

event when user wants to attach magazine

event when user wants to unjam weapon

event when user wants to end loading of bullets

event when user wants to load N bullets

event when user wants to load 1 bullet

event when trigger pressed

Parameters
dstinventory location where the magazine will be stored

Definition at line 34 of file Events.c.

Constructor & Destructor Documentation

◆ WeaponEventBase()

void WeaponEventBase::WeaponEventBase ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 40 of file Events.c.

40{ m_eventID = 0; m_player = p; m_magazine = m; }
Magazine m_magazine
Definition Events.c:38
DayZPlayer m_player
Definition Events.c:37

References m_eventID, m_magazine, and m_player.

Member Function Documentation

◆ DumpToString()

string WeaponEventBase::DumpToString ( )
inlineprivate

Definition at line 62 of file Events.c.

63 {
64 string res = "{ WpnEv id=" + typename.EnumToString(WeaponEventID, GetEventID());
65 res = res + " pl=" + Object.GetDebugName(m_player);
66 res = res + " mag=" + Object.GetDebugName(m_magazine);
67 res = res + " }";
68 return res;
69 }
WeaponEventID
identifier for events. mainly for rpc purposes
Definition Events.c:6
WeaponEventID GetEventID()
returns id from enum WeaponEventID
Definition Events.c:42

References GetEventID(), m_magazine, and m_player.

◆ GetAnimEvent() [1/2]

WeaponEvents WeaponEventBase::GetAnimEvent ( )
inlineprivate

returns animation event from anim engine,

See also
WeaponEvents

Definition at line 44 of file Events.c.

44{ return -1; }

Referenced by GetPackedType().

◆ GetAnimEvent() [2/2]

override int WeaponEventBase::GetAnimEvent ( )
inlineprivate

Definition at line 219 of file Events.c.

219{ return m_type; }
WeaponEvents m_type
Definition Events.c:217

◆ GetEventID()

WeaponEventID WeaponEventBase::GetEventID ( )
inlineprivate

returns id from enum WeaponEventID

Definition at line 42 of file Events.c.

42{ return m_eventID; }

References m_eventID.

Referenced by DumpToString().

◆ GetPackedType()

int WeaponEventBase::GetPackedType ( )
inlineprivate

returns eventID in upper 16 bits and AnimEvent in lower 16 bits

Definition at line 46 of file Events.c.

47 {
48 int animEvent = GetAnimEvent() & 0x0000ffff;
49 int evShl = m_eventID << 16;
50 return evShl | animEvent;
51 }
WeaponEvents GetAnimEvent()
returns animation event from anim engine,
Definition Events.c:44

References GetAnimEvent(), and m_eventID.

Referenced by WriteToContext().

◆ ReadFromContext() [1/3]

void WeaponEventBase::ReadFromContext ( ParamsReadContext ctx)
inlineprivate

Definition at line 53 of file Events.c.

53{ }

Referenced by CreateWeaponEventFromContext().

◆ ReadFromContext() [2/3]

override void WeaponEventBase::ReadFromContext ( ParamsReadContext ctx)
inlineprivate

Definition at line 152 of file Events.c.

153 {
155 super.ReadFromContext(ctx);
156 m_dst.ReadFromContext(ctx);
157 }
InventoryLocation.
ref InventoryLocation m_dst
Definition Events.c:149

References m_dst.

◆ ReadFromContext() [3/3]

override void WeaponEventBase::ReadFromContext ( ParamsReadContext ctx)
inlineprivate

Definition at line 171 of file Events.c.

172 {
173 super.ReadFromContext(ctx);
175 m_dst.ReadFromContext(ctx);
176 }

References m_dst.

◆ WeaponEventAnimation()

void WeaponEventBase::WeaponEventAnimation ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

animation event from Human.WeaponEvents

Definition at line 218 of file Events.c.

218{ m_eventID = WeaponEventID.ANIMATION_EVENT; }

◆ WeaponEventAttachMagazine()

void WeaponEventBase::WeaponEventAttachMagazine ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 130 of file Events.c.

130{ m_eventID = WeaponEventID.ATTACH_MAGAZINE; }

◆ WeaponEventContinuousLoadBulletEnd()

void WeaponEventBase::WeaponEventContinuousLoadBulletEnd ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 118 of file Events.c.

118{ m_eventID = WeaponEventID.CONTINUOUS_LOADBULLET_END; }

◆ WeaponEventContinuousLoadBulletStart()

void WeaponEventBase::WeaponEventContinuousLoadBulletStart ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 112 of file Events.c.

112{ m_eventID = WeaponEventID.CONTINUOUS_LOADBULLET_START; }

◆ WeaponEventDetachMagazine()

void WeaponEventBase::WeaponEventDetachMagazine ( DayZPlayer p = NULL,
Magazine m = NULL,
InventoryLocation il = NULL )
inlineprivate

Definition at line 150 of file Events.c.

150{ m_eventID = WeaponEventID.DETACH_MAGAZINE; m_dst = il; }

References m_dst.

◆ WeaponEventDryFireTimeout()

void WeaponEventBase::WeaponEventDryFireTimeout ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 205 of file Events.c.

205{ m_eventID = WeaponEventID.DRY_FIRE_TIMEOUT; }

◆ WeaponEventHumanCommandActionAborted()

void WeaponEventBase::WeaponEventHumanCommandActionAborted ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 193 of file Events.c.

193{ m_eventID = WeaponEventID.HUMANCOMMAND_ACTION_ABORTED; }

◆ WeaponEventHumanCommandActionFinished()

void WeaponEventBase::WeaponEventHumanCommandActionFinished ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 187 of file Events.c.

187{ m_eventID = WeaponEventID.HUMANCOMMAND_ACTION_FINISHED; }

◆ WeaponEventLoad1Bullet()

void WeaponEventBase::WeaponEventLoad1Bullet ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 106 of file Events.c.

106{ m_eventID = WeaponEventID.LOAD1_BULLET; }

◆ WeaponEventMechanism()

void WeaponEventBase::WeaponEventMechanism ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 76 of file Events.c.

76{ m_eventID = WeaponEventID.MECHANISM; }

◆ WeaponEventReloadTimeout()

void WeaponEventBase::WeaponEventReloadTimeout ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 199 of file Events.c.

199{ m_eventID = WeaponEventID.RELOAD_TIMEOUT; }

◆ WeaponEventSetNextMuzzleMode()

void WeaponEventBase::WeaponEventSetNextMuzzleMode ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 212 of file Events.c.

212{ m_eventID = WeaponEventID.SET_NEXT_MUZZLE_MODE; }

◆ WeaponEventSwapMagazine()

void WeaponEventBase::WeaponEventSwapMagazine ( DayZPlayer p = NULL,
Magazine m = NULL,
InventoryLocation il = NULL )
inlineprivate

Definition at line 169 of file Events.c.

169{ m_eventID = WeaponEventID.SWAP_MAGAZINE; m_dst = il; }

References m_dst.

◆ WeaponEventTrigger()

void WeaponEventBase::WeaponEventTrigger ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 82 of file Events.c.

82{ m_eventID = WeaponEventID.TRIGGER; }

◆ WeaponEventTriggerAutoEnd()

void WeaponEventBase::WeaponEventTriggerAutoEnd ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 100 of file Events.c.

100{ m_eventID = WeaponEventID.TRIGGER_AUTO_END; }

◆ WeaponEventTriggerAutoStart()

void WeaponEventBase::WeaponEventTriggerAutoStart ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 94 of file Events.c.

94{ m_eventID = WeaponEventID.TRIGGER_AUTO_START; }

◆ WeaponEventTriggerToJam()

void WeaponEventBase::WeaponEventTriggerToJam ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 88 of file Events.c.

88{ m_eventID = WeaponEventID.TRIGGER_JAM; }

◆ WeaponEventUnjam()

void WeaponEventBase::WeaponEventUnjam ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 124 of file Events.c.

124{ m_eventID = WeaponEventID.UNJAM; }

◆ WeaponEventUnjammingFailedTimeout()

void WeaponEventBase::WeaponEventUnjammingFailedTimeout ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 136 of file Events.c.

136{ m_eventID = WeaponEventID.UNJAMMING_FAILED_TIMEOUT; }

◆ WeaponEventUnjammingTimeout()

void WeaponEventBase::WeaponEventUnjammingTimeout ( DayZPlayer p = NULL,
Magazine m = NULL )
inlineprivate

Definition at line 142 of file Events.c.

142{ m_eventID = WeaponEventID.UNJAMMING_TIMEOUT; }

◆ WriteToContext() [1/3]

void WeaponEventBase::WriteToContext ( ParamsWriteContext ctx)
inlineprivate

Definition at line 54 of file Events.c.

55 {
57 ctx.Write(packedType);
58 ctx.Write(m_player);
59 ctx.Write(m_magazine);
60 }
int GetPackedType()
returns eventID in upper 16 bits and AnimEvent in lower 16 bits
Definition Events.c:46

References GetPackedType(), m_magazine, and m_player.

◆ WriteToContext() [2/3]

override void WeaponEventBase::WriteToContext ( ParamsWriteContext ctx)
inlineprivate

Definition at line 158 of file Events.c.

159 {
160 super.WriteToContext(ctx);
161 m_dst.WriteToContext(ctx);
162 }

References m_dst.

◆ WriteToContext() [3/3]

override void WeaponEventBase::WriteToContext ( ParamsWriteContext ctx)
inlineprivate

Definition at line 177 of file Events.c.

178 {
179 super.WriteToContext(ctx);
180 m_dst.WriteToContext(ctx);
181 }

References m_dst.

Member Data Documentation

◆ m_dst

ref InventoryLocation WeaponEventBase::m_dst
private

Definition at line 149 of file Events.c.

◆ m_eventID

int WeaponEventBase::m_eventID
private

Definition at line 36 of file Events.c.

Referenced by GetEventID(), GetPackedType(), and WeaponEventBase().

◆ m_magazine

Magazine WeaponEventBase::m_magazine
private

Definition at line 38 of file Events.c.

Referenced by DumpToString(), WeaponEventBase(), and WriteToContext().

◆ m_player

DayZPlayer WeaponEventBase::m_player
private

Definition at line 37 of file Events.c.

Referenced by DumpToString(), WeaponEventBase(), and WriteToContext().

◆ m_type

WeaponEvents WeaponEventBase::m_type
private

Definition at line 217 of file Events.c.


The documentation for this class was generated from the following file: