-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
73 lines (62 loc) · 1.41 KB
/
Game.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef GAME_H
#define GAME_H
#ifdef __APPLE__
#include <SDL2_mixer/SDL_mixer.h>
#else
#include "SDL_mixer.h"
#endif
#include <cstdio>
#include <algorithm>
#include <string>
#include <sstream>
#include <iostream>
#include <memory>
#include <regex>
#include "Defines.h"
#include "Tile.h"
#include "EntityPlayer.h"
#include "Renderer.h"
#include "Chunk.h"
#include "CollisionHandler.h"
#include "ChunkUtility.h"
#include "Network.h"
#include "Settings.h"
#include "PerlinNoise.h"
#include "Settings.h"
#include "SimplexNoise.h"
#include "Chat.h"
#include "Utility.h"
#include "Json.h"
#include "InventoryManager.h"
class Game
{
public:
Game(std::shared_ptr<Json>, std::string, std::shared_ptr<Graphic>);
~Game(void);
void onEvent(SDL_Event*, const Uint8*);
bool isRunning(void);
void update(float, const Uint8*);
void render(void);
void collision(void);
bool hasNewState(void);
STATE requestStateChange(void);
private:
std::HashMap<glm::ivec2, std::shared_ptr<Chunk> > chunks;
std::vector<std::shared_ptr<PlayerMP> > players;
std::shared_ptr<Camera> cam;
std::shared_ptr<EntityPlayer> player;
std::shared_ptr<Network> net;
std::shared_ptr<Chat> chat;
std::shared_ptr<Json> json;
std::shared_ptr<Graphic> graphic;
std::shared_ptr<InventoryManager> invManager;
std::unique_ptr<Renderer> renderer;
Mix_Chunk* music;
bool running;
bool online;
bool keyFocus;
float tmpTime;
bool newState;
STATE state;
};
#endif