41 lines
657 B
C++
41 lines
657 B
C++
#pragma once
|
|
|
|
#include "World.h"
|
|
#include <map>
|
|
|
|
namespace blitz {
|
|
namespace game {
|
|
|
|
class Player;
|
|
|
|
typedef std::map<PlayerID, Player*> PlayerMap;
|
|
|
|
class Game {
|
|
private:
|
|
PlayerMap m_Players;
|
|
World* m_World;
|
|
|
|
public:
|
|
Game(World* world) : m_World(world) {}
|
|
|
|
virtual void Tick(std::uint64_t delta) = 0;
|
|
|
|
Player* GetPlayerById(PlayerID id);
|
|
const Player* GetPlayerById(PlayerID id) const;
|
|
|
|
PlayerMap& GetPlayers() {
|
|
return m_Players;
|
|
}
|
|
|
|
const PlayerMap& GetPlayers() const {
|
|
return m_Players;
|
|
}
|
|
|
|
Player* AddPlayer(PlayerID player, const std::string& name);
|
|
void RemovePlayer(PlayerID player);
|
|
};
|
|
|
|
|
|
} // namespace game
|
|
} // namespace blitz
|