DarkflameServer/dGame/TeamManager.h

37 lines
680 B
C
Raw Permalink Normal View History

#pragma once
#include "Entity.h"
struct Team
{
LWOOBJID teamID = LWOOBJID_EMPTY;
char lootOption = 0;
2022-07-28 13:39:57 +00:00
std::vector<LWOOBJID> members{};
char lootRound = 0;
};
class TeamManager
{
public:
2022-07-28 13:39:57 +00:00
static TeamManager* Instance() {
if (!m_Address) {
m_Address = new TeamManager();
}
2022-07-28 13:39:57 +00:00
return m_Address;
}
Team* GetTeam(LWOOBJID member) const;
LWOOBJID GetNextLootOwner(Team* team) const;
void UpdateTeam(LWOOBJID teamId, char lootOption, const std::vector<LWOOBJID>& members);
void DeleteTeam(LWOOBJID teamId);
2022-07-28 13:39:57 +00:00
explicit TeamManager();
~TeamManager();
private:
2022-07-28 13:39:57 +00:00
static TeamManager* m_Address; //For singleton method
std::unordered_map<LWOOBJID, Team*> m_Teams{};
};