chore: KDIS datatypes
[KDIS.git] / KDIS / DataTypes / MinePaintScheme.h
blob3ed931d861d88f895bd0d1c98b9b99256efdc5bf
1 /*********************************************************************
3 Copyright 2013 Karl Jones
4 All rights reserved.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice, this
10 list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 For Further Information Please Contact me at
27 Karljj1@yahoo.com
28 http://p.sf.net/kdis/UserGuide
29 *********************************************************************/
31 /********************************************************************
32 class: MinePaintScheme
33 created: 13/06/2010
34 author: Karl Jones
36 purpose: Represents the Paint Scheme of a mine.
37 size: 8 bits / 1 octet
38 *********************************************************************/
40 #pragma once
42 #include "./DataTypeBase.h"
44 namespace KDIS {
45 namespace DATA_TYPE {
47 class KDIS_EXPORT MinePaintScheme : public DataTypeBase
49 protected:
51 union
53 struct
55 KUINT8 m_ui8Alg : 2;
56 KUINT8 m_ui8Scm : 6;
59 KUINT8 m_ui8PntSchm;
60 } m_PntScmUnion;
62 public:
64 static const KUINT16 MINE_PAINT_SCHEME_SIZE = 1;
66 MinePaintScheme();
68 MinePaintScheme( KDIS::DATA_TYPE::ENUMS::MineAlgae A, KDIS::DATA_TYPE::ENUMS::PaintScheme PS );
70 MinePaintScheme( KDataStream & stream ) ;
72 virtual ~MinePaintScheme();
74 //************************************
75 // FullName: KDIS::DATA_TYPE::MinePaintScheme::SetAlgae
76 // KDIS::DATA_TYPE::MinePaintScheme::GetAlgae
77 // Description: The algae build-up on the mine.
78 // Parameter: MineAlgae A
79 //************************************
80 void SetAlgae( KDIS::DATA_TYPE::ENUMS::MineAlgae A );
81 KDIS::DATA_TYPE::ENUMS::MineAlgae GetAlgae() const;
83 //************************************
84 // FullName: KDIS::DATA_TYPE::MinePaintScheme::SetPaintScheme
85 // KDIS::DATA_TYPE::MinePaintScheme::GetPaintScheme
86 // Description: The paint scheme of the mine.
87 // Parameter: PaintScheme PS
88 //************************************
89 void SetPaintScheme( KDIS::DATA_TYPE::ENUMS::PaintScheme PS );
90 KDIS::DATA_TYPE::ENUMS::PaintScheme GetPaintScheme() const;
92 //************************************
93 // FullName: KDIS::DATA_TYPE::MinePaintScheme::GetAsString
94 // Description: Returns a string representation
95 //************************************
96 virtual KString GetAsString() const;
98 //************************************
99 // FullName: KDIS::DATA_TYPE::MinePaintScheme::Decode
100 // Description: Convert From Network Data.
101 // Parameter: KDataStream & stream
102 //************************************
103 virtual void Decode( KDataStream & stream ) ;
105 //************************************
106 // FullName: KDIS::DATA_TYPE::MinePaintScheme::Encode
107 // Description: Convert To Network Data.
108 // Parameter: KDataStream & stream
109 //************************************
110 virtual KDataStream Encode() const;
111 virtual void Encode( KDataStream & stream ) const;
113 KBOOL operator == ( const MinePaintScheme & Value ) const;
114 KBOOL operator != ( const MinePaintScheme & Value ) const;
117 } // END namespace DATA_TYPES
118 } // END namespace KDIS