diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-02-25 13:05:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-25 13:05:18 +0100 |
commit | 55e432becc8c5a1b8dd6543cc0a26e0213aeb88f (patch) | |
tree | f5d7dea2c6dc5a3d2feb8f4c0413f83beef61793 /src/GameState.hpp | |
parent | Raycast debug render (diff) | |
parent | min/max functions (diff) | |
download | AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.gz AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.bz2 AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.lz AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.xz AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.zst AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.zip |
Diffstat (limited to 'src/GameState.hpp')
-rw-r--r-- | src/GameState.hpp | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/src/GameState.hpp b/src/GameState.hpp index fac9923..81ab3dc 100644 --- a/src/GameState.hpp +++ b/src/GameState.hpp @@ -20,40 +20,42 @@ public: ~GameState() = default; - void Update(float deltaTime); + void Update(float deltaTime); void UpdatePacket(std::shared_ptr<Packet> 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 PlaceBlock(); + 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 +63,8 @@ public: Window playerInventory; std::vector<Window> openedWindows; - Vector selectedBlock; - float distanceToSelectedBlock; - VectorF raycastHit; + bool isBlockSelected; + Vector selectedBlock; + float distanceToSelectedBlock; + VectorF raycastHit; }; |