80 LOGWARN(
"Could not craft map - Too many maps in use");
101 if (!IDSerializer.
Load())
106 unsigned int MapCount = IDSerializer.
GetMapCount();
110 for (
unsigned int i = 0; i < MapCount; ++i)
116 if (!Serializer.
Load())
118 LOGWARN(
"Could not load map #%i",
Map.GetID());
142 if (!IDSerializer.
Save())
144 LOGERROR(
"Could not save idcounts.dat");
154 if (!Serializer.
Save())
156 LOGWARN(
"Could not save map #%i",
Map.GetID());
void LOGERROR(std::string_view a_Format, const Args &... args)
Encapsulates an in-game world map.
void LoadMapData(void)
Loads the map data from the disk.
cMapManager(cWorld *a_World)
void TickMaps(void)
Ticks each registered map.
cMap * GetMapData(unsigned int a_ID)
Returns the map with the specified ID, nullptr if out of range.
cMap * CreateMap(int a_CenterX, int a_CenterY, unsigned int a_Scale=3)
Creates a new map.
bool DoWithMap(UInt32 a_ID, cMapCallback a_Callback)
Calls the callback for the map with the specified ID.
void SaveMapData(void)
Saves the map data to the disk.
RAII for cCriticalSection - locks the CS on creation, unlocks on destruction.
const AString & GetDataPath(void) const
Returns the data path to the world data.
Utility class used to serialize maps.
bool Load(void)
Try to load the map.
bool Save(void)
Try to save the map.
Utility class used to serialize item ID counts.
bool Save(void)
Try to save the ID counts.
bool Load(void)
Try to load the ID counts.
void SetMapCount(unsigned int a_MapCount)
unsigned int GetMapCount(void) const