refactor(Core/Game): restyle game lib with astyle (#3466)

This commit is contained in:
Kargatum
2020-10-12 15:08:15 +07:00
committed by GitHub
parent e99b526e17
commit a2b26272d2
338 changed files with 52196 additions and 50944 deletions

View File

@@ -85,8 +85,7 @@ void WaypointMgr::Load()
path.push_back(wp);
++count;
}
while (result->NextRow());
} while (result->NextRow());
sLog->outString(">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
@@ -133,20 +132,19 @@ void WaypointMgr::ReloadPath(uint32 id)
wp->z = z;
wp->orientation = o;
wp->move_type = fields[5].GetUInt32();
if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX)
{
//TC_LOG_ERROR("sql.sql", "Waypoint %u in waypoint_data has invalid move_type, ignoring", wp->id);
delete wp;
continue;
}
wp->delay = fields[6].GetUInt32();
wp->event_id = fields[7].GetUInt32();
wp->event_chance = fields[8].GetUInt8();
path.push_back(wp);
}
while (result->NextRow());
} while (result->NextRow());
}

View File

@@ -36,30 +36,30 @@ typedef std::unordered_map<uint32, WaypointPath> WaypointPathContainer;
class WaypointMgr
{
public:
static WaypointMgr* instance();
public:
static WaypointMgr* instance();
// Attempts to reload a single path from database
void ReloadPath(uint32 id);
// Attempts to reload a single path from database
void ReloadPath(uint32 id);
// Loads all paths from database, should only run on startup
void Load();
// Loads all paths from database, should only run on startup
void Load();
// Returns the path from a given id
WaypointPath const* GetPath(uint32 id) const
{
WaypointPathContainer::const_iterator itr = _waypointStore.find(id);
if (itr != _waypointStore.end())
return &itr->second;
// Returns the path from a given id
WaypointPath const* GetPath(uint32 id) const
{
WaypointPathContainer::const_iterator itr = _waypointStore.find(id);
if (itr != _waypointStore.end())
return &itr->second;
return nullptr;
}
return nullptr;
}
private:
WaypointMgr();
~WaypointMgr();
private:
WaypointMgr();
~WaypointMgr();
WaypointPathContainer _waypointStore;
WaypointPathContainer _waypointStore;
};
#define sWaypointMgr WaypointMgr::instance()