From 99354db9db9be0f921980f081ee7ed6515d2dcdc Mon Sep 17 00:00:00 2001 From: Elisey Puzko Date: Tue, 20 Feb 2018 13:09:39 +0300 Subject: New event: SelectedBlockChanged --- src/GameState.hpp | 64 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 31 deletions(-) (limited to 'src/GameState.hpp') diff --git a/src/GameState.hpp b/src/GameState.hpp index fac9923..7183e64 100644 --- a/src/GameState.hpp +++ b/src/GameState.hpp @@ -20,40 +20,41 @@ public: ~GameState() = default; - void Update(float deltaTime); + void Update(float deltaTime); void UpdatePacket(std::shared_ptr ptr); - enum Direction { - FORWARD, BACKWARD, LEFT, RIGHT, JUMP - }; - void StartDigging(); - void StopDigging(); - void HandleMovement(GameState::Direction direction, float deltaTime); - void HandleRotation(double yaw, double pitch); - glm::mat4 GetViewMatrix(); + enum Direction { + FORWARD, BACKWARD, LEFT, RIGHT, JUMP + }; + void StartDigging(); + void FinishDigging(); + void CancelDigging(); + void HandleMovement(GameState::Direction direction, float deltaTime); + void HandleRotation(double yaw, double pitch); + glm::mat4 GetViewMatrix(); Entity* player; - World world; + World world; - std::string g_PlayerUuid = ""; - std::string g_PlayerName = ""; - bool g_IsGameStarted = false; - int g_PlayerEid = 0; - int g_Gamemode = 0; - int g_Dimension = 0; - unsigned char g_Difficulty = 0; - unsigned char g_MaxPlayers = 0; - std::string g_LevelType = ""; - bool g_ReducedDebugInfo = false; - Vector g_SpawnPosition; - bool g_PlayerInvulnerable = false; - bool g_PlayerFlying = false; - bool g_PlayerAllowFlying = false; - bool g_PlayerCreativeMode = false; - float g_PlayerFlyingSpeed = 0; - float g_PlayerFovModifier = 0; - float g_PlayerHealth = 0; + std::string g_PlayerUuid = ""; + std::string g_PlayerName = ""; + bool g_IsGameStarted = false; + int g_PlayerEid = 0; + int g_Gamemode = 0; + int g_Dimension = 0; + unsigned char g_Difficulty = 0; + unsigned char g_MaxPlayers = 0; + std::string g_LevelType = ""; + bool g_ReducedDebugInfo = false; + Vector g_SpawnPosition; + bool g_PlayerInvulnerable = false; + bool g_PlayerFlying = false; + bool g_PlayerAllowFlying = false; + bool g_PlayerCreativeMode = false; + float g_PlayerFlyingSpeed = 0; + float g_PlayerFovModifier = 0; + float g_PlayerHealth = 0; long long WorldAge = 0; long long TimeOfDay = 0; @@ -61,7 +62,8 @@ public: Window playerInventory; std::vector openedWindows; - Vector selectedBlock; - float distanceToSelectedBlock; - VectorF raycastHit; + bool isBlockSelected; + Vector selectedBlock; + float distanceToSelectedBlock; + VectorF raycastHit; }; -- cgit v1.2.3