Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actiondebug.c
Go to the documentation of this file.
1 class ActionDebugReciveData : ActionReciveData
2 {
3  ItemBase m_Item;
4  int m_DebugActionID;
5  EntityAI m_Entity;
6 }
7 
8 class ActionDebugData : ActionData
9 {
10  int m_DebugActionID;
12 }
13 
15 {
16  override bool HasTarget()
17  {
18  return false;
19  }
20 
21  override void CreateConditionComponents()
22  {
25  }
26 
27  override ActionData CreateActionData()
28  {
29  ActionDebugData action_data = new ActionDebugData;
30  return action_data;
31  }
32 
33  override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data = NULL)
34  {
35  ActionDebugData action_data_d;
36  Class.CastTo( action_data_d, CreateActionData());
37  action_data_d.m_Action = this;
38  action_data_d.m_Player = player;
39 
40  if (!GetGame().IsDedicatedServer() )
41  {
42  ref Param2<EntityAI,int> ndata = Param2<EntityAI,int>.Cast( extra_data );
43  action_data_d.m_Entity = ndata.param1;
44  action_data_d.m_DebugActionID = ndata.param2;
45  }
46 
47  ActionReciveData action_recive_data = player.GetActionManager().GetReciveData();
48  if ( action_recive_data )
49  {
50  HandleReciveData(action_recive_data,action_data_d);
51  }
52  action_data = action_data_d;
53 
54  return true;
55  }
56 
57  override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
58  {
59  ActionDebugData action_data_d;
60  Class.CastTo( action_data_d, action_data );
61 
62  ctx.Write(action_data_d.m_Entity);
63  ctx.Write(action_data_d.m_DebugActionID);
64  }
65 
66  override bool ReadFromContext(ParamsReadContext ctx, out ActionReciveData action_recive_data )
67  {
68  if(!action_recive_data)
69  {
70  action_recive_data = new ActionDebugReciveData;
71  }
72 
73  ActionDebugReciveData action_recive_data_d = ActionDebugReciveData.Cast(action_recive_data);
74 
75  EntityAI ent;
76  int debugActionID;
77 
78  if(!ctx.Read(ent))
79  return false;
80  if(!ctx.Read(debugActionID))
81  return false;
82 
83  action_recive_data_d.m_Entity = ent;
84  action_recive_data_d.m_DebugActionID = debugActionID;
85  return true;
86  }
87 
88  override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
89  {
90  ActionDebugReciveData action_recive_data_d = ActionDebugReciveData.Cast(action_recive_data);
91  ActionDebugData action_data_d = ActionDebugData.Cast(action_data);
92 
93  action_data_d.m_Entity = action_recive_data_d.m_Entity;
94  action_data_d.m_DebugActionID = action_recive_data_d.m_DebugActionID;
95  }
96 
97  override void Start(ActionData action_data)
98  {
99  ActionDebugData action_data_d;
100  Class.CastTo( action_data_d, action_data );
101  if (action_data_d.m_Entity && !action_data_d.m_Entity.IsSetForDeletion())
102  action_data_d.m_Entity.OnAction(action_data_d.m_DebugActionID,action_data_d.m_Player,NULL);
103  }
104 
105  override bool UseAcknowledgment()
106  {
107  return false;
108  }
109 
110 };
ItemBase
Definition: inventoryitem.c:730
Param2
Definition: ppeconstants.c:66
GetGame
proto native CGame GetGame()
ActionInstantBase
Definition: actioninstantbase.c:1
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
CCINone
Definition: ccinone.c:1
CCTNone
Definition: cctnone.c:1
ActionDebugReciveData
Definition: actiondebug.c:1
ActionDebug
Definition: actiondebug.c:14
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
m_DebugActionID
ActionDebugReciveData m_DebugActionID
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
EntityAI
Definition: building.c:5
m_Entity
EntityAI m_Entity
Definition: actiondebug.c:11