KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GED_EnhancedGroundCombatVehicle.h
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
29 
30 /********************************************************************
31  class: GED_EnhancedGroundCombatVehicle
32  created: 07/06/2009
33  author: Karl Jones
34 
35  purpose: Contains entity state information about an individual entity
36  within a group of enhanced ground combat vehicles.
37  size: 192 bits / 24 octets
38 *********************************************************************/
39 
40 #pragma once
41 
43 
44 namespace KDIS {
45 namespace DATA_TYPE {
46 
48 {
49 protected:
50 
52 
54 
56 
58 
59 public:
60 
61  static const KUINT16 GED_ENHANCED_GROUND_COMBAT_VEHICLE_SIZE = 24;
62 
64 
66 
67  GED_EnhancedGroundCombatVehicle( KUINT16 ID, KINT16 XOffset, KINT16 YOffset, KINT16 ZOffset, const EntityAppearance & EA, KINT8 Psi,
68  KINT8 Theta, KINT8 Phi, KINT8 Speed, KINT8 TurretAzimuth, KINT8 GunElevation, KINT8 TurretSlewRate,
69  KINT8 GunElevationRate, KUINT8 FuelStatus, KUINT8 GroundMaintenanceStatus, KUINT8 PrimaryAmmunition,
70  KUINT8 SecondaryAmmunition );
71 
72  GED_EnhancedGroundCombatVehicle( const GED_BasicGroundCombatVehicle & BGCV, KUINT8 FuelStatus, KUINT8 GroundMaintenanceStatus,
73  KUINT8 PrimaryAmmunition, KUINT8 SecondaryAmmunition );
74 
76 
77  //************************************
78  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::GetGroupedEntityCategory
79  //!Description: Identifies the derived GED class.
80  //! Not part of the DIS PDU.
81  //************************************
82  virtual KDIS::DATA_TYPE::ENUMS::GroupedEntityCategory GetGroupedEntityCategory() const;
83 
84  //************************************
85  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::GetLength
86  //!Description: Returns size of the GED in octets.
87  //! Not part of the DIS PDU.
88  //************************************
89  virtual KUINT8 GetLength() const;
90 
91  //************************************
92  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::SetFuelStatus
93  // KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::GetFuelStatus
94  //!Description: Represents the amount of fuel remaining.
95  //! Specified in 10 liter increments.
96  // Parameter: KUINT8 F, void
97  //************************************
98  void SetFuelStatus( KUINT8 F );
99  KUINT8 GetFuelStatus() const;
100 
101  //************************************
102  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::SetGroundMaintenanceStatus
103  // KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::GetGroundMaintenanceStatus
104  //!Description: Distance traveled since the last failure.
105  //! Specified in tens of kilometers.
106  // Parameter: KUINT8 G, void
107  //************************************
108  void SetGroundMaintenanceStatus( KUINT8 G );
109  KUINT8 GetGroundMaintenanceStatus() const;
110 
111  //************************************
112  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::SetPrimaryAmmunition
113  // KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::GetPrimaryAmmunition
114  //!Description: Amount of primary ammunition remaining.
115  //! Specified in natural ammunition units for the primary weapon system.
116  // Parameter: KUINT8 P, void
117  //************************************
118  void SetPrimaryAmmunition( KUINT8 P );
119  KUINT8 GetPrimaryAmmunition() const;
120 
121  //************************************
122  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::SetSecondaryAmmunition
123  // KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::GetSecondaryAmmunition
124  //!Description: Amount of secondary ammunition remaining.
125  //! Specified in natural ammunition units for the secondary weapon system.
126  // Parameter: KUINT8 S, void
127  //************************************
128  void SetSecondaryAmmunition( KUINT8 S );
129  KUINT8 GetSecondaryAmmunition() const;
130 
131  //************************************
132  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::GetAsString
133  //!Description: Returns a string representation
134  //************************************
135  virtual KString GetAsString() const;
136 
137  //************************************
138  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::Decode
139  //!Description: Convert From Network Data.
140  // Parameter: KDataStream & stream
141  //************************************
142  virtual void Decode( KDataStream & stream ) throw( KException );
143 
144  //************************************
145  // FullName: KDIS::DATA_TYPE::GED_EnhancedGroundCombatVehicle::Encode
146  //!Description: Convert To Network Data.
147  // Parameter: KDataStream & stream
148  //************************************
149  virtual KDataStream Encode() const;
150  virtual void Encode( KDataStream & stream ) const;
151 
152  KBOOL operator == ( const GED_EnhancedGroundCombatVehicle & Value ) const;
153  KBOOL operator != ( const GED_EnhancedGroundCombatVehicle & Value ) const;
154 };
155 
156 } // END namespace DATA_TYPES
157 } // END namespace KDIS
158 
Definition: GED_EnhancedGroundCombatVehicle.h:47
KUINT8 m_ui8PriAmmun
Definition: GED_EnhancedGroundCombatVehicle.h:55
short int KINT16
Definition: KDefines.h:102
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: EntityAppearance.h:58
char KINT8
Definition: KDefines.h:100
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
KUINT8 m_ui8GrndMaintStatus
Definition: GED_EnhancedGroundCombatVehicle.h:53
Definition: GED_BasicGroundCombatVehicle.h:48
unsigned char KUINT8
Definition: KDefines.h:99
KUINT8 m_ui8FuelStatus
Definition: GED_EnhancedGroundCombatVehicle.h:51
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8SecAmmun
Definition: GED_EnhancedGroundCombatVehicle.h:57
GroupedEntityCategory
Definition: EnumEntityManagement.h:118