VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCigiDiGuyCtrl.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2019 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <CigiBaseVariableSizePckt.h>
15 
16 #include <string>
17 
18 
19 //+> Packet layout
20 // |-------------------------------------------------------------------------------------------------------------------------------|
21 // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
22 // |-------------------------------------------------------------------------------------------------------------------------------|
23 // | Packet Id = 201 | Packet Size = 16+strLen | Entity ID |
24 // |-------------------------------------------------------------------------------------------------------------------------------|
25 // | Reserved | *4 | *3| *2| *1| Reserved | *9| *8| *7| *6| *5| Reserved |
26 // |-------------------------------------------------------------------------------------------------------------------------------|
27 // | Animation speed |
28 // | |
29 // |-------------------------------------------------------------------------------------------------------------------------------|
30 // | Animation (variable, multiple of 8 bytes) |
31 // |_______________________________________________________________________________________________________________________________|
32 
33 // *1 Action Paused
34 // *2 Weapon State
35 // *3 Health State
36 // *4 Posture
37 // *5 Action Paused Enable
38 // *6 Weapon State Enable
39 // *7 Health State Enable
40 // *8 Posture Enable
41 // *9 Animation Speed Enable
42 //
43 namespace makCigiExt
44 {
45 
46  const int CIGI_DI_GUY_CTRL_PACKET_ID = 201;
47 
48  // This is the size of the FIXED portion of the packet
50 
51  //=========================================================
56  {
57  public:
58  //=========================================================
62  {
63  Unpaused=0,
64  Paused=1
65  };
66 
67  //=========================================================
71  {
72  Stowed=0,
73  Deployed=1
74  };
75 
76  //=========================================================
80  {
81  Standing=0,
82  Sitting=1,
83  Crouched=2,
84  Prone=3
85  };
86 
87  //=========================================================
91  {
92  Alive=0,
93  Dead=1
94  };
95 
96  //==> Management
97 
98  //=========================================================
101  DtCigiDiGuyCtrl(void);
102 
103  //=========================================================
106  virtual ~DtCigiDiGuyCtrl(void);
107 
108  //=========================================================
111  DtCigiDiGuyCtrl(const DtCigiDiGuyCtrl &BaseIn);
112 
113  //=========================================================
116  DtCigiDiGuyCtrl& operator=(const DtCigiDiGuyCtrl& BaseIn);
117 
118  //==> Buffer Packing/Unpacking
119 
120  //=========================================================
131  virtual int Pack(CigiBasePacket * Base, Cigi_uint8 * Buff, void *Spec) const;
132 
133  //=========================================================
143  virtual int Unpack(Cigi_uint8 * Buff, bool Swap, void *Spec);
144 
145  //=========================================================
153  { return(PacketSize + refPacket.GetVariableDataSize()); }
154 
155  //==> Accessing Member Variable Values functions
156 
157  //+> EntityID
158 
159  //=========================================================
169  int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
170  {
171  myEntityID = EntityIDIn;
172  return(CIGI_SUCCESS);
173  }
174 
175  //=========================================================
181  Cigi_uint16 GetEntityID(void) const { return(myEntityID); }
182 
183  //+> PostureEn
184 
185  //=========================================================
193  int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
194  {
195  myPostureEn = PostureEnIn;
196  return(CIGI_SUCCESS);
197  }
198 
199  //=========================================================
202  bool GetPostureEn(void) const { return(myPostureEn); }
203 
204  //+> Posture
205 
206  //=========================================================
218  int SetPosture(const PostureGrp PostureIn, bool bndchk=true);
219 
220  //=========================================================
228  PostureGrp GetPosture(void) const { return(myPosture); }
229 
230  //+> WeaponStateEn
231 
232  //=========================================================
240  int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
241  {
242  myWeaponStateEn = WeaponStateEnIn;
243  return(CIGI_SUCCESS);
244  }
245 
246  //=========================================================
249  bool GetWeaponStateEn(void) const { return(myWeaponStateEn); }
250 
251  //+> WeaponState
252 
253  //=========================================================
263  int SetWeaponState(const WeaponStateGrp WeaponStateIn, bool bndchk=true);
264 
265  //=========================================================
271  WeaponStateGrp GetWeaponState(void) const { return(myWeaponState); }
272 
273  //+> AnimationStateEn
274 
275  //=========================================================
283  int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
284  {
285  myAnimationStateEn = AnimationStateEnIn;
286  return(CIGI_SUCCESS);
287  }
288 
289  //=========================================================
292  bool GetAnimationStateEn(void) const { return(myAnimationStateEn); }
293 
294  //+> AnimationState
295 
296  //=========================================================
306  int SetAnimationState(const AnimationStateGrp AnimationStateIn, bool bndchk=true);
307 
308  //=========================================================
314  AnimationStateGrp GetAnimationState(void) const { return(myAnimationState); }
315 
316  //+> HealthStateEn
317 
318  //=========================================================
326  int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
327  {
328  myHealthStateEn = HealthStateEnIn;
329  return(CIGI_SUCCESS);
330  }
331 
332  //=========================================================
335  bool GetHealthStateEn(void) const { return(myHealthStateEn); }
336 
337  //+> HealthState
338 
339  //=========================================================
349  int SetHealthState(const HealthStateGrp HealthStateIn, bool bndchk=true);
350 
351  //=========================================================
357  HealthStateGrp GetHealthState(void) const { return(myHealthState); }
358 
359  //+> AnimationSpeedEn
360 
361  //=========================================================
369  int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
370  {
371  myAnimationSpeedEn = AnimationSpeedEnIn;
372  return(CIGI_SUCCESS);
373  }
374 
375  //=========================================================
378  bool GetAnimationSpeedEn(void) const { return(myAnimationSpeedEn); }
379 
380  //+> Animation Speed
381 
382  //=========================================================
389  int SetAnimationSpeed(const double AnimationSpeedIn, bool bndchk=true);
390 
391  //=========================================================
395  double GetAnimationSpeed(void) const { return(myAnimationSpeed); }
396 
397  //+> Animation
398 
401  int SetAnimation(const std::string &AnimationIn, bool bndchk=true);
402 
405  int GetAnimationSize(void) const { return(VariableDataSize); }
406 
407  //=========================================================
410  const std::string & GetAnimation(void) const { return(myAnimation); }
411 
412  protected:
413 
414  Cigi_uint16 myEntityID;
417  std::string myAnimation;
421 
427 
428  //=========================================================
433  static const int MaxCharCnt = 224;
434  };
435 }
436 
bool GetAnimationSpeedEn(void) const
Gets the AnimationSpeedEn value.
Definition: DtCigiDiGuyCtrl.h:378
std::string myAnimation
Definition: DtCigiDiGuyCtrl.h:417
AnimationStateGrp myAnimationState
Definition: DtCigiDiGuyCtrl.h:419
double myAnimationSpeed
Definition: DtCigiDiGuyCtrl.h:418
bool GetHealthStateEn(void) const
Gets the HealthStateEn value.
Definition: DtCigiDiGuyCtrl.h:335
PostureGrp myPosture
Definition: DtCigiDiGuyCtrl.h:415
The base class for all packets.
Definition: DtCigiDiGuyCtrl.h:54
bool myPostureEn
Definition: DtCigiDiGuyCtrl.h:422
double GetAnimationSpeed(void) const
Gets the AnimationSpeed.
Definition: DtCigiDiGuyCtrl.h:395
Cigi_uint16 GetEntityID(void) const
Gets the Entity ID value.
Definition: DtCigiDiGuyCtrl.h:181
Contains DLL export macros.
bool myHealthStateEn
Definition: DtCigiDiGuyCtrl.h:426
AnimationStateGrp GetAnimationState(void) const
Gets the AnimationState value.
Definition: DtCigiDiGuyCtrl.h:314
HealthStateGrp
The enumeration for the Health flag.
Definition: DtCigiDiGuyCtrl.h:90
bool myAnimationStateEn
Definition: DtCigiDiGuyCtrl.h:424
const int CIGI_DI_GUY_CTRL_PACKET_SIZE
Definition: DtCigiDiGuyCtrl.h:49
WeaponStateGrp myWeaponState
Definition: DtCigiDiGuyCtrl.h:416
WeaponStateGrp GetWeaponState(void) const
Gets the WeaponState value.
Definition: DtCigiDiGuyCtrl.h:271
const int CIGI_DI_GUY_CTRL_PACKET_ID
Definition: DtCigiDiGuyCtrl.h:46
int SetPostureEn(const bool PostureEnIn, bool bndchk=true)
Sets the PostureEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:193
int SetWeaponStateEn(const bool WeaponStateEnIn, bool bndchk=true)
Sets the WeaponStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:240
bool myAnimationSpeedEn
Definition: DtCigiDiGuyCtrl.h:425
PostureGrp
The enumeration for the Posture flags.
Definition: DtCigiDiGuyCtrl.h:79
bool GetAnimationStateEn(void) const
Gets the AnimationStateEn value.
Definition: DtCigiDiGuyCtrl.h:292
Cigi_uint16 myEntityID
Definition: DtCigiDiGuyCtrl.h:414
bool myWeaponStateEn
Definition: DtCigiDiGuyCtrl.h:423
HealthStateGrp myHealthState
Definition: DtCigiDiGuyCtrl.h:420
const std::string & GetAnimation(void) const
Gets the Animation (Action) string.
Definition: DtCigiDiGuyCtrl.h:410
bool GetWeaponStateEn(void) const
Gets the WeaponStateEn value.
Definition: DtCigiDiGuyCtrl.h:249
virtual int GetTruePacketSize(CigiBaseVariableSizePckt &refPacket)
A virtual function to determine the size that the packet will take up when packed.
Definition: DtCigiDiGuyCtrl.h:152
int SetAnimationStateEn(const bool AnimationStateEnIn, bool bndchk=true)
Sets the AnimationStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:283
int SetAnimationSpeedEn(const bool AnimationSpeedEnIn, bool bndchk=true)
Sets the AnimationSpeedEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:369
#define DT_DLL_MAKCIGIEXTENSIONS
Definition: makCigiExtensions.h:17
HealthStateGrp GetHealthState(void) const
Gets the HealthState value.
Definition: DtCigiDiGuyCtrl.h:357
int GetAnimationSize(void) const
Definition: DtCigiDiGuyCtrl.h:405
bool GetPostureEn(void) const
Gets the PostureEn value.
Definition: DtCigiDiGuyCtrl.h:202
WeaponStateGrp
The enumeration for the Weapon State flag.
Definition: DtCigiDiGuyCtrl.h:70
int SetHealthStateEn(const bool HealthStateEnIn, bool bndchk=true)
Sets the HealthStateEn with bound checking control.
Definition: DtCigiDiGuyCtrl.h:326
int SetEntityID(const Cigi_uint16 EntityIDIn, bool bndchk=true)
Sets the Entity ID with bound checking control.
Definition: DtCigiDiGuyCtrl.h:169
PostureGrp GetPosture(void) const
Gets the Posture value.
Definition: DtCigiDiGuyCtrl.h:228
AnimationStateGrp
The enumeration for the Animation Paused/Not Paused flag.
Definition: DtCigiDiGuyCtrl.h:61

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)