00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _OPENCITY_LAYER_H_
00021 #define _OPENCITY_LAYER_H_ 1
00022
00023 #include "main.h"
00024
00025 #include "persistence.h"
00026 #include "ui.h"
00027
00028 class Structure;
00029 class GUIContainer;
00030 class GUIButton;
00031
00032
00033
00037 class Layer : public Persistence, public UI
00038 {
00039 public:
00040 Layer( );
00041
00042 virtual
00043 ~Layer( );
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00065 virtual const bool
00066 IsConstructive(
00067 uint W1, uint L1,
00068 uint W2, uint L2,
00069 const OPENCITY_STRUCTURE_CODE & enumStructCode ) const = 0;
00070
00071
00072
00082 virtual const OPENCITY_ERR_CODE
00083 BuildPreview(
00084 const uint & W,
00085 const uint & L,
00086 const OPENCITY_STRUCTURE_CODE & enumStructCode,
00087 OPENCITY_GRAPHIC_CODE & enumGraphicCode ) const = 0;
00088
00089
00090
00096 virtual const OPENCITY_ERR_CODE
00097 BuildStructure(
00098 const uint & W1,
00099 const uint & L1,
00100 const uint & W2,
00101 const uint & L2,
00102 const OPENCITY_STRUCTURE_CODE & enumStructCode,
00103 uint& rCost ) = 0;
00104
00105
00106
00112 virtual const OPENCITY_ERR_CODE
00113 ResizeStructure(
00114 const uint & w,
00115 const uint & l,
00116 const OPENCITY_GRAPHIC_CODE & oldGC ) = 0;
00117
00118
00119
00124 virtual const OPENCITY_ERR_CODE
00125 DestroyStructure(
00126 uint W1, uint L1,
00127 uint W2, uint L2,
00128 uint& rCost ) = 0;
00129
00130
00131
00137 virtual Structure*
00138 GetLinearStructure( const uint cuiLinearIndex ) const = 0;
00139
00140
00141
00145 virtual Structure*
00146 GetStructure(
00147 const uint & w,
00148 const uint & l ) const = 0;
00149
00150
00151
00157 virtual Structure*
00158 GetRandomStructure(
00159 uint & w,
00160 uint & l,
00161 const OPENCITY_STRUCTURE_CODE & enumStructCode = OC_STRUCTURE_UNDEFINED ) const = 0;
00162
00163
00164
00167 virtual const uint
00168 GetNumberStructure() const = 0;
00169
00170
00171 const uint
00172 GetMaxLinear() const;
00173
00174
00175
00180 void
00181 GetLayerSize(
00182 uint & w,
00183 uint & l) const;
00184
00185
00186
00190 virtual void
00191 StructureSet(
00192 const OC_BYTE & status ) = 0;
00193
00194
00195
00199 virtual void
00200 StructureUnset(
00201 const OC_BYTE & status ) = 0;
00202
00203
00204
00207 virtual const bool
00208 ContainStructure(
00209 const uint & W1,
00210 const uint & L1,
00211 const uint & W2,
00212 const uint & L2,
00213 const OPENCITY_STRUCTURE_CODE & enumStructCode ) const = 0;
00214
00215
00216
00220 virtual const bool
00221 ContainStructureOnly(
00222 const uint & W1,
00223 const uint & L1,
00224 const uint & W2,
00225 const uint & L2,
00226 const OPENCITY_STRUCTURE_CODE & enumStructCode ) const = 0;
00227
00228
00229
00234 virtual GUIContainer*
00235 QueryStructure(
00236 const uint & w,
00237 const uint & l ) const = 0;
00238
00239
00240 protected:
00241 uint _uiLayerWidth;
00242 uint _uiLayerLength;
00243
00244
00245 protected:
00246
00247
00248
00249
00251 static uint uiNumberLayer;
00252
00253
00257 static GUIButton* pbtnQW;
00258 static GUIButton* pbtnQE;
00259 static GUIButton* pbtnQG;
00260 static GUIButton* pbtnQR;
00261 static GUIButton* pbtnQC;
00262 static GUIButton* pbtnQI;
00263 static GUIButton* pbtnQP;
00264 };
00265
00266 #endif
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304