summaryrefslogtreecommitdiffstats
path: root/src/GameState.hpp
diff options
context:
space:
mode:
authorElisey Puzko <puzko.e02@gmail.com>2018-02-20 11:09:39 +0100
committerElisey Puzko <puzko.e02@gmail.com>2018-02-20 11:09:39 +0100
commit99354db9db9be0f921980f081ee7ed6515d2dcdc (patch)
treec48ef29357234ea618472bf3ec796c03b7f2a647 /src/GameState.hpp
parentAnother attempt at increasing readability (diff)
downloadAltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar
AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.gz
AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.bz2
AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.lz
AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.xz
AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.tar.zst
AltCraft-99354db9db9be0f921980f081ee7ed6515d2dcdc.zip
Diffstat (limited to '')
-rw-r--r--src/GameState.hpp64
1 files changed, 33 insertions, 31 deletions
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<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 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<Window> openedWindows;
- Vector selectedBlock;
- float distanceToSelectedBlock;
- VectorF raycastHit;
+ bool isBlockSelected;
+ Vector selectedBlock;
+ float distanceToSelectedBlock;
+ VectorF raycastHit;
};