mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 14:58:27 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
36
dGame/TeamManager.h
Normal file
36
dGame/TeamManager.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "Entity.h"
|
||||
|
||||
struct Team
|
||||
{
|
||||
LWOOBJID teamID = LWOOBJID_EMPTY;
|
||||
char lootOption = 0;
|
||||
std::vector<LWOOBJID> members {};
|
||||
char lootRound = 0;
|
||||
};
|
||||
|
||||
class TeamManager
|
||||
{
|
||||
public:
|
||||
static TeamManager* Instance() {
|
||||
if (!m_Address) {
|
||||
m_Address = new TeamManager();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
explicit TeamManager();
|
||||
~TeamManager();
|
||||
|
||||
private:
|
||||
static TeamManager* m_Address; //For singleton method
|
||||
std::unordered_map<LWOOBJID, Team*> m_Teams {};
|
||||
};
|
||||
|
Reference in New Issue
Block a user