#include <zone_manager.h>
Inheritance diagram for NL3D::CZoneLoadingTask:
Nevrax France
Definition at line 161 of file zone_manager.h.
Public Member Functions | |
CZoneLoadingTask (const std::string &sZoneName, TVolatileZonePtr *ppZone, CVector &pos, bool monochrome, float factor) | |
Constructor. | |
void | getName (std::string &result) const |
void | run (void) |
Runnable Task. | |
Data Fields | |
NLMISC::CVector | Position |
Private Attributes | |
bool | _Monochrome |
float | _TileColorFactor |
TVolatileZonePtr * | _Zone |
std::string | _ZoneName |
|
Constructor.
Definition at line 233 of file zone_manager.cpp. References _Monochrome, _TileColorFactor, _Zone, _ZoneName, and NL3D::TVolatileZonePtr.
00234 { 00235 *ppZone = NULL; 00236 _Zone = ppZone; 00237 _ZoneName = sZoneName; 00238 Position = pos; 00239 _Monochrome = monochrome; 00240 _TileColorFactor = max(0.0f, factor); 00241 } |
|
Reimplemented from NLMISC::IRunnable. Definition at line 271 of file zone_manager.cpp. References _ZoneName.
00272 { 00273 result = "LoadZone(" + _ZoneName + ")"; 00274 } |
|
Runnable Task.
Implements NLMISC::IRunnable. Definition at line 244 of file zone_manager.cpp. References _Monochrome, _TileColorFactor, _Zone, _ZoneName, file, nldebug, NL3D::CZone::serial(), and NL3D::CZone::setTileColor().
00245 { 00246 // Lookup the zone 00247 string zonePathLookup = CPath::lookup (_ZoneName, false, false, true); 00248 if (zonePathLookup == "") 00249 zonePathLookup = _ZoneName; 00250 00251 CZone *ZoneTmp = new CZone; 00252 CIFile file; 00253 if(file.open(zonePathLookup)) 00254 { 00255 ZoneTmp->serial(file); 00256 file.close(); 00257 ZoneTmp->setTileColor(_Monochrome, _TileColorFactor); 00258 *_Zone = ZoneTmp; 00259 } 00260 else 00261 { 00262 nldebug("CZoneLoadingTask::run(): File not found: %s", zonePathLookup.c_str ()); 00263 delete ZoneTmp; 00264 *_Zone = (CZone*)-1; // Return error 00265 } 00266 delete this; 00267 } |
|
Definition at line 175 of file zone_manager.h. Referenced by CZoneLoadingTask(), and run(). |
|
Definition at line 176 of file zone_manager.h. Referenced by CZoneLoadingTask(), and run(). |
|
Definition at line 173 of file zone_manager.h. Referenced by CZoneLoadingTask(), and run(). |
|
Definition at line 174 of file zone_manager.h. Referenced by CZoneLoadingTask(), getName(), and run(). |
|
Definition at line 46 of file task_manager.h. |