summaryrefslogtreecommitdiffstats
path: root/src/Event.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-05 17:07:10 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-05 17:07:10 +0200
commitc9c78e191dd71bacd769bbeccd58b80e4376184b (patch)
tree4da1a8500dd73dd6368fc89496dc0f428d318c5b /src/Event.hpp
parent2017-08-03 (diff)
downloadAltCraft-c9c78e191dd71bacd769bbeccd58b80e4376184b.tar
AltCraft-c9c78e191dd71bacd769bbeccd58b80e4376184b.tar.gz
AltCraft-c9c78e191dd71bacd769bbeccd58b80e4376184b.tar.bz2
AltCraft-c9c78e191dd71bacd769bbeccd58b80e4376184b.tar.lz
AltCraft-c9c78e191dd71bacd769bbeccd58b80e4376184b.tar.xz
AltCraft-c9c78e191dd71bacd769bbeccd58b80e4376184b.tar.zst
AltCraft-c9c78e191dd71bacd769bbeccd58b80e4376184b.zip
Diffstat (limited to 'src/Event.hpp')
-rw-r--r--src/Event.hpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Event.hpp b/src/Event.hpp
index 229da19..c553058 100644
--- a/src/Event.hpp
+++ b/src/Event.hpp
@@ -11,6 +11,7 @@
#include "Vector.hpp"
#include "Packet.hpp"
+#include "FSM.hpp"
enum class EventType {
Echo,
@@ -23,6 +24,7 @@ enum class EventType {
RegisterNetworkClient,
PlayerConnected,
RemoveLoadingScreen,
+ ConnectionFailed,
};
struct EchoData {
@@ -47,12 +49,15 @@ struct ConnectionSuccessfullData {
enum class GlobalState {
InitialLoading,
MainMenu,
+ Connecting,
Loading,
- InGame,
+ Playing,
PauseMenu,
Exiting,
};
+void SetGlobalState(GlobalState state);
+
struct GlobalAppStateData {
GlobalState state;
};
@@ -87,9 +92,13 @@ struct RemoveLoadingScreenData {
};
+struct ConnectionFailedData {
+ std::string reason;
+};
+
using EventData = std::variant<EchoData, ChunkChangedData, ConnectToServerData, ConnectionSuccessfullData,
GlobalAppStateData, DisconnectData, SendPacketData, ReceivePacketData, RequestNetworkClientData,
- RegisterNetworkClientData, PlayerConnectedData, RemoveLoadingScreenData>;
+ RegisterNetworkClientData, PlayerConnectedData, RemoveLoadingScreenData, ConnectionFailedData>;
struct Event {
EventType type;