1 /*********************************************************************
2 Copyright 2013 Karl Jones
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
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.
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.
25 For Further Information Please Contact me at
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
31 class: MunitionDescriptor
35 purpose: Represents the firing of a a round or a burst of ammunition
36 This data type is also referred to as a Burst Descriptor in older versions of DIS.
37 This descriptor is applicable to the Fire PDU and Detonation PDU.
38 size: 128 bits / 16 octets
39 *********************************************************************/
43 #include "./Descriptor.h"
48 class KDIS_EXPORT MunitionDescriptor
: public Descriptor
52 KUINT16 m_ui16Warhead
;
56 KUINT16 m_ui16Quantity
;
64 MunitionDescriptor( KDataStream
& stream
);
66 MunitionDescriptor( const EntityType
& T
, KDIS::DATA_TYPE::ENUMS::WarheadType WT
,
67 KDIS::DATA_TYPE::ENUMS::FuseType FT
, KUINT16 Quantity
, KUINT16 Rate
);
69 virtual ~MunitionDescriptor();
71 //************************************
72 // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetWarhead
73 // KDIS::DATA_TYPE::MunitionDescriptor::GetWarhead
74 // Description: Warhead type enumeration.
75 // Parameter: WarheadType WT
76 //************************************
77 void SetWarhead( KDIS::DATA_TYPE::ENUMS::WarheadType WT
);
78 KDIS::DATA_TYPE::ENUMS::WarheadType
GetWarhead() const;
80 //************************************
81 // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetFuse
82 // KDIS::DATA_TYPE::MunitionDescriptor::GetFuse
83 // Description: Fuse type enumeration.
84 // Parameter: FuseType FT
85 //************************************
86 void SetFuse( KDIS::DATA_TYPE::ENUMS::FuseType FT
);
87 KDIS::DATA_TYPE::ENUMS::FuseType
GetFuse() const;
89 //************************************
90 // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetQuantity
91 // KDIS::DATA_TYPE::MunitionDescriptor::GetQuantity
92 // Description: Number of rounds fired in the burst.
93 // Parameter: KUINT16 Q
94 //************************************
95 void SetQuantity( KUINT16 Q
);
96 KUINT16
GetQuantity() const;
98 //************************************
99 // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetRate
100 // KDIS::DATA_TYPE::MunitionDescriptor::GetRate
101 // Description: Rounds per minute.
102 // Parameter: KUINT16 R
103 //************************************
104 void SetRate( KUINT16 R
);
105 KUINT16
GetRate() const;
107 //************************************
108 // FullName: KDIS::DATA_TYPE::MunitionDescriptor::GetAsString
109 // Description: Returns a string representation.
110 //************************************
111 virtual KString
GetAsString() const;
113 //************************************
114 // FullName: KDIS::DATA_TYPE::MunitionDescriptor::Decode
115 // Description: Convert From Network Data.
116 // Parameter: KDataStream & stream
117 //************************************
118 virtual void Decode( KDataStream
& stream
) ;
120 //************************************
121 // FullName: KDIS::DATA_TYPE::MunitionDescriptor::Encode
122 // Description: Convert To Network Data.
123 // Parameter: KDataStream & stream
124 //************************************
125 virtual KDataStream
Encode() const;
126 virtual void Encode( KDataStream
& stream
) const;
128 KBOOL
operator == ( const MunitionDescriptor
& Value
) const;
129 KBOOL
operator != ( const MunitionDescriptor
& Value
) const;
132 } // END namespace DATA_TYPES
133 } // END namespace KDIS