guild_base.cpp & .h include header cleanup

This commit is contained in:
Akkadius 2014-12-15 21:59:23 -06:00
parent 0c21f56ff3
commit 20200fd028
2 changed files with 118 additions and 113 deletions

View File

@ -16,7 +16,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "debug.h"
#include "guild_base.h" #include "guild_base.h"
#include "database.h" #include "database.h"
#include "logsys.h" #include "logsys.h"

View File

@ -3,13 +3,13 @@
#include "guilds.h" #include "guilds.h"
#include <map> #include <map>
#include <string>
#include <vector> #include <vector>
class Database; class Database;
class CharGuildInfo { class CharGuildInfo
public: {
public:
//fields from `characer_` //fields from `characer_`
uint32 char_id; uint32 char_id;
std::string char_name; std::string char_name;
@ -30,13 +30,17 @@ public:
}; };
//this object holds guild functionality shared between world and zone. //this object holds guild functionality shared between world and zone.
class BaseGuildManager { class BaseGuildManager
public: {
public:
BaseGuildManager(); BaseGuildManager();
virtual ~BaseGuildManager(); virtual ~BaseGuildManager();
//this must be called before doing anything else with this object //this must be called before doing anything else with this object
void SetDatabase(Database *db) { m_db = db; } void SetDatabase(Database *db)
{
m_db = db;
}
bool LoadGuilds(); bool LoadGuilds();
bool RefreshGuild(uint32 guild_id); bool RefreshGuild(uint32 guild_id);
@ -89,7 +93,7 @@ public:
static const char *const GuildActionNames[_MaxGuildAction]; static const char *const GuildActionNames[_MaxGuildAction];
uint32 DoesAccountContainAGuildLeader(uint32 AccountID); uint32 DoesAccountContainAGuildLeader(uint32 AccountID);
protected: protected:
//the methods which must be defined by base classes. //the methods which must be defined by base classes.
virtual void SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) = 0; virtual void SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) = 0;
virtual void SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) = 0; virtual void SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) = 0;
@ -114,13 +118,15 @@ protected:
bool LocalDeleteGuild(uint32 guild_id); bool LocalDeleteGuild(uint32 guild_id);
class RankInfo { class RankInfo
{
public: public:
RankInfo(); RankInfo();
std::string name; std::string name;
bool permissions[_MaxGuildAction]; bool permissions[_MaxGuildAction];
}; };
class GuildInfo { class GuildInfo
{
public: public:
GuildInfo(); GuildInfo();
std::string name; std::string name;
@ -132,7 +138,7 @@ protected:
uint32 leader_char_id; uint32 leader_char_id;
uint8 minstatus; uint8 minstatus;
//tribute is not in here on purpose, since it is only valid in world! //tribute is not in here on purpose, since it is only valid in world!
RankInfo ranks[GUILD_MAX_RANK+1]; RankInfo ranks[GUILD_MAX_RANK + 1];
}; };
std::map<uint32, GuildInfo *> m_guilds; //we own the pointers in this map std::map<uint32, GuildInfo *> m_guilds; //we own the pointers in this map