00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __MAP_TILE_H__
00031 #define __MAP_TILE_H__
00032
00034
00035
00036
00037
00038
00039
00127
00128
00129
00130
00131
00132
00133
00134
00135 #ifndef __UNIT_CACHE_H__
00136 #include "unit_cache.h"
00137 #endif
00138
00139
00140
00141
00142
00143
00145 class CMapField {
00146 public:
00147
00148 CMapField() : Tile(0), SeenTile(0), Flags(0), Cost(0), Value(0), UnitCache()
00149 #ifdef DEBUG
00150 , TilesetTile(0)
00151 #endif
00152 {
00153 memset(Visible, 0, sizeof(Visible));
00154 memset(Guard, 0, sizeof(Guard));
00155 memset(VisCloak, 0, sizeof(VisCloak));
00156 memset(Radar, 0, sizeof(Radar));
00157 memset(RadarJammer, 0, sizeof(RadarJammer));
00158 }
00159
00160 unsigned short Tile;
00161 unsigned short SeenTile;
00162 unsigned short Flags;
00163 unsigned char Cost;
00164
00165
00166 unsigned char Value;
00167 unsigned short Visible[PlayerMax];
00168 unsigned short Guard[PlayerMax];
00169 unsigned char VisCloak[PlayerMax];
00170 unsigned char Radar[PlayerMax];
00171 unsigned char RadarJammer[PlayerMax];
00172 CUnitCache UnitCache;
00173 #ifdef DEBUG
00174 unsigned int TilesetTile;
00175 #endif
00176
00178 bool IsExplored(const unsigned int player_index) const
00179 {
00180 return !!Visible[player_index];
00181 };
00182
00183 };
00184
00185
00187
00188 #endif // !__MAP_TILE_H__
00189