-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
72 lines (57 loc) · 1.32 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
#ifndef GAME_H
#define GAME_H
#include"stdafx.h"
#include"Character.h"
#include"Buildings.h"
#include"Cursor.h"
#include"MainMenu.h"
#include"Screen.h"
//Test
#include<iostream>
namespace nnk {
enum class GameState{ End, Running};
enum class CommunicationMode { Receive, Send };
class Game {
private:
sf::RenderWindow* renderWindow;
sf::Event gameEvent;
// 캐릭터 좌표 저장해서 view에 넣기.
sf::View view;
cursor::Cursor cursor;
sf::Vector2f cursorLocation;
menu::MainMenu menu;
character::Character character;
std::list<character::Character> npcList;
buildings::Buildings buildings;
screen::Screen screen;
GameState gameState = GameState::End;
// server & client
const int PORT_NO = 2000;
CommunicationMode communicationMode;
#ifdef SERVER
server::Server server;
#elif defined CLIENT
client::Client client;
#else
#endif
void initWindow(std::string windowName);
void setView();
public:
Game();
~Game();
void setGameState(GameState gameState);
GameState getGameState();
sf::RenderWindow* getRenderWindow();
bool getWindowIsOpen();
void pollEvent();
void addNPC(character::Character npc);
void deleteNPC(std::string npcName);
void init();
void render();
void update();
//server & client
void initCommunication();
void communication();
};
}
#endif //GAME_H