mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-21 23:08:21 +00:00
[Dynamic Zones] Rename dynamic zone structs (#1327)
* Rename dz member id field The name of the struct is enough to make this implicit * Rename dz member enum and struct Rename ExpeditionMember to DynamicZoneMember Rename ExpeditionMemberStatus to DynamicZoneMemberStatus * Rename dz window packet structs This makes it more clear the window may be used by any dynamic zone system not just expeditions (live missions fill the window when player doesn't have an active expedition). * Rename dz window packet fields
This commit is contained in:
@@ -1,28 +1,13 @@
|
||||
#ifndef COMMON_EXPEDITION_BASE_H
|
||||
#define COMMON_EXPEDITION_BASE_H
|
||||
|
||||
#include "eq_constants.h"
|
||||
#include "dynamic_zone_base.h"
|
||||
#include "repositories/expeditions_repository.h"
|
||||
#include "repositories/expedition_members_repository.h"
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct ExpeditionMember
|
||||
{
|
||||
uint32_t char_id = 0;
|
||||
std::string name;
|
||||
ExpeditionMemberStatus status = ExpeditionMemberStatus::Online;
|
||||
|
||||
ExpeditionMember() = default;
|
||||
ExpeditionMember(uint32_t id, const std::string& name_)
|
||||
: char_id(id), name(name_) {}
|
||||
ExpeditionMember(uint32_t id, const std::string& name_, ExpeditionMemberStatus status_)
|
||||
: char_id(id), name(name_), status(status_) {}
|
||||
|
||||
bool IsValid() const { return char_id != 0 && !name.empty(); }
|
||||
};
|
||||
|
||||
class ExpeditionBase
|
||||
{
|
||||
public:
|
||||
@@ -33,16 +18,16 @@ public:
|
||||
ExpeditionBase& operator=(ExpeditionBase&&) = default;
|
||||
|
||||
uint32_t GetID() const { return m_id; }
|
||||
uint32_t GetLeaderID() const { return m_leader.char_id; }
|
||||
uint32_t GetLeaderID() const { return m_leader.id; }
|
||||
uint32_t GetMinPlayers() const { return m_min_players; }
|
||||
uint32_t GetMaxPlayers() const { return m_max_players; }
|
||||
uint32_t GetMemberCount() const { return static_cast<uint32_t>(m_members.size()); }
|
||||
const std::string& GetName() const { return m_expedition_name; }
|
||||
const std::string& GetLeaderName() const { return m_leader.name; }
|
||||
const std::string& GetUUID() const { return m_uuid; }
|
||||
const std::vector<ExpeditionMember>& GetMembers() const { return m_members; }
|
||||
const std::vector<DynamicZoneMember>& GetMembers() const { return m_members; }
|
||||
|
||||
void AddInternalMember(const ExpeditionMember& member);
|
||||
void AddInternalMember(const DynamicZoneMember& member);
|
||||
void ClearInternalMembers() { m_members.clear(); }
|
||||
bool HasMember(const std::string& character_name);
|
||||
bool HasMember(uint32_t character_id);
|
||||
@@ -55,10 +40,10 @@ public:
|
||||
protected:
|
||||
ExpeditionBase() = default;
|
||||
ExpeditionBase(uint32_t id, const std::string& uuid, const std::string& expedition_name,
|
||||
const ExpeditionMember& leader, uint32_t min_players, uint32_t max_players);
|
||||
const DynamicZoneMember& leader, uint32_t min_players, uint32_t max_players);
|
||||
|
||||
ExpeditionMember GetMemberData(uint32_t character_id);
|
||||
ExpeditionMember GetMemberData(const std::string& character_name);
|
||||
DynamicZoneMember GetMemberData(uint32_t character_id);
|
||||
DynamicZoneMember GetMemberData(const std::string& character_name);
|
||||
|
||||
uint32_t m_id = 0;
|
||||
uint32_t m_min_players = 0;
|
||||
@@ -67,8 +52,8 @@ protected:
|
||||
bool m_add_replay_on_join = true;
|
||||
std::string m_uuid;
|
||||
std::string m_expedition_name;
|
||||
ExpeditionMember m_leader;
|
||||
std::vector<ExpeditionMember> m_members;
|
||||
DynamicZoneMember m_leader;
|
||||
std::vector<DynamicZoneMember> m_members;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user