chore: KDIS datatypes
[KDIS.git] / KDIS / DataTypes / ArealObjectAppearance.h
blobe24a9e6d3d54eebc475fc3f782dd87b1e4ad2c00
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
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
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
31 class: ArealObjectAppearance
32 created: 17/03/2010
33 author: Karl Jones
35 purpose: Represents a areal objects appearance.
36 size: 48 Bits / 6 Octet
37 *********************************************************************/
39 #pragma once
41 #include "./ObjectAppearance.h"
43 namespace KDIS {
44 namespace DATA_TYPE {
46 class KDIS_EXPORT ArealObjectAppearance : public ObjectAppearance
48 protected:
50 union
52 struct
54 KUINT32 m_ui32Breach : 2;
55 KUINT32 m_ui32Unused : 14;
56 KUINT32 m_ui32Mines : 16;
57 } m_Minefield;
59 KUINT32 m_ui32SpecificAppearance;
60 } m_SpecificAppearanceUnion;
62 public:
64 static const KUINT16 AREAL_OBJECT_APPEARANCE_SIZE = 6;
66 ArealObjectAppearance();
68 ArealObjectAppearance( KDataStream & stream ) ;
70 virtual ~ArealObjectAppearance();
72 /************************************************************************/
73 /* The following appearance values are only for areal's of the type: */
74 /* Minefield */
75 /************************************************************************/
77 //************************************
78 // FullName: KDIS::DATA_TYPE::ArealObjectAppearance::SetBreach
79 // KDIS::DATA_TYPE::ArealObjectAppearance::GetBreach
80 // Description: Describes the breached appearance of the object.
81 // Parameter: Breach2bit B, void
82 ////************************************
83 void SetBreach( KDIS::DATA_TYPE::ENUMS::Breach2bit B );
84 KDIS::DATA_TYPE::ENUMS::Breach2bit GetBreach() const;
86 //************************************
87 // FullName: KDIS::DATA_TYPE::ArealObjectAppearance::SetMineCount
88 // KDIS::DATA_TYPE::ArealObjectAppearance::GetMineCount
89 // Description: The number of mines in the minefield.
90 // Parameter: KUINT16 M, void
91 //************************************
92 void SetMineCount( KUINT16 M );
93 KUINT16 GetMineCount() const;
95 //************************************
96 // FullName: KDIS::DATA_TYPE::ArealObjectAppearance::GetAsString
97 // Description: Returns a string representation of the appearance
98 // Parameter: const EntityType & EntType
99 //************************************
100 virtual KString GetAsString() const;
102 //************************************
103 // FullName: KDIS::DATA_TYPE::ArealObjectAppearance::Decode
104 // Description: Convert From Network Data.
105 // Parameter: KDataStream & stream
106 //************************************
107 virtual void Decode( KDataStream & stream ) ;
109 //************************************
110 // FullName: KDIS::DATA_TYPE::ArealObjectAppearance::Encode
111 // Description: Convert To Network Data.
112 // Parameter: KDataStream & stream
113 //************************************
114 virtual KDataStream Encode() const;
115 virtual void Encode( KDataStream & stream ) const;
117 KBOOL operator == ( const ArealObjectAppearance & Value ) const;
118 KBOOL operator != ( const ArealObjectAppearance & Value ) const;
121 } // END namespace DATA_TYPES
122 } // END namespace KDIS