summaryrefslogtreecommitdiffstats
path: root/code/Game.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-13 16:01:56 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-05-13 16:01:56 +0200
commit1563ae5be6bc130a9b3a23464f7e28fdb1e87da3 (patch)
treeb1f65a03827494fa78e320b134f4cc7df54754bb /code/Game.hpp
parent2017-05-12 (diff)
downloadAltCraft-1563ae5be6bc130a9b3a23464f7e28fdb1e87da3.tar
AltCraft-1563ae5be6bc130a9b3a23464f7e28fdb1e87da3.tar.gz
AltCraft-1563ae5be6bc130a9b3a23464f7e28fdb1e87da3.tar.bz2
AltCraft-1563ae5be6bc130a9b3a23464f7e28fdb1e87da3.tar.lz
AltCraft-1563ae5be6bc130a9b3a23464f7e28fdb1e87da3.tar.xz
AltCraft-1563ae5be6bc130a9b3a23464f7e28fdb1e87da3.tar.zst
AltCraft-1563ae5be6bc130a9b3a23464f7e28fdb1e87da3.zip
Diffstat (limited to 'code/Game.hpp')
-rw-r--r--code/Game.hpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/code/Game.hpp b/code/Game.hpp
new file mode 100644
index 0000000..b9096a5
--- /dev/null
+++ b/code/Game.hpp
@@ -0,0 +1,58 @@
+#pragma once
+
+#include "PositionI.hpp"
+#include "NetworkClient.hpp"
+#include "World.hpp"
+#include "graphics/Display.hpp"
+
+class Game {
+public:
+ Game();
+
+ ~Game();
+
+ void Exec();
+
+private:
+ //utility variables
+ NetworkClient *m_nc;
+ std::thread m_ncThread;
+ bool m_exit = false;
+ ConnectionState m_networkState = ConnectionState::Handshaking;
+ Display *m_display;
+ std::thread m_gameThread;
+
+ //utility methods
+ void ParsePackets();
+ void MainLoop();
+
+ //GameState update - condVars
+ std::condition_variable gameStartWaiter;
+
+ //game state variables
+ World m_world;
+
+ std::string g_PlayerUuid;
+ std::string g_PlayerName;
+ int g_PlayerEid;
+ byte g_Gamemode;
+ byte g_Difficulty;
+ int g_Dimension;
+ byte g_MaxPlayers;
+ std::string g_LevelType;
+ bool g_ReducedDebugInfo;
+ PositionI g_SpawnPosition;
+ bool g_PlayerInvulnerable;
+ bool g_PlayerFlying;
+ bool g_PlayerAllowFlying;
+ bool g_PlayerCreativeMode;
+ int g_PlayerFlyingSpeed;
+ int g_PlayerFovModifier;
+ bool g_IsGameStarted = false;
+ float g_PlayerPitch;
+ float g_PlayerYaw;
+ double g_PlayerX;
+ double g_PlayerY;
+ double g_PlayerZ;
+};
+