feat: implement basic tower placement

This commit is contained in:
2021-09-19 13:43:45 +02:00
parent bcde4278ab
commit 52a143769e
17 changed files with 318 additions and 52 deletions

View File

@@ -12,8 +12,11 @@
namespace td {
namespace client {
class Client;
class ClientGame : public protocol::PacketHandler, public game::Game{
private:
Client* m_Client;
std::uint8_t m_ConnexionID;
std::uint32_t m_LobbyTime = 0;
game::Player* m_Player = nullptr;
@@ -21,7 +24,7 @@ private:
client::WorldClient m_WorldClient;
render::WorldRenderer m_WorldRenderer;
public:
ClientGame(protocol::PacketDispatcher* dispatcher, render::Renderer* renderer);
ClientGame(Client* client);
virtual ~ClientGame();
virtual void tick(std::uint64_t delta);
@@ -31,6 +34,13 @@ public:
std::uint32_t getLobbyTime() const{return m_LobbyTime;}
const game::Player* getPlayer() const{return m_Player;}
render::Renderer* getRenderer() const {return m_Renderer;}
void PlaceTower(game::TowerType type, const glm::vec2& position);
bool CanPlaceLittleTower(const glm::vec2& worldPos);
bool CanPlaceBigTower(const glm::vec2& worldPos);
virtual void HandlePacket(protocol::ConnexionInfoPacket* packet);
virtual void HandlePacket(protocol::PlayerJoinPacket* packet);
virtual void HandlePacket(protocol::PlayerLeavePacket* packet);