-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
42 lines (38 loc) · 943 Bytes
/
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
//
// Created by leafeon on 11/6/19.
//
#ifndef PVZ_GAME_H
#define PVZ_GAME_H
#include "common.h"
#include "objects.h"
#include <pthread.h>
class Game{
private:
static int sunshine, score;
int shop_idx, board_row, board_col;
vector<int> shop_col;
int shop_row;
int sunshine_timer; //automatic sunshine
int zombie_wave;
int difficulty;
string status;
Cursor cursor;
InfoBoard infoBoard;
static vector<Unit*> units;
public:
friend class InfoBoard;
Game();
void init_screen();
void inputHandler(char ch);
void sendTimeSignal();
static bool setAvailable(int r,int c);
static void addUnit(Unit* unit);
static void deleteUnit(int unitId);
static void addSunshine(int num);
static bool consumeSunshine(int num);
void interaction();
void generateZombie();
static void addScore(int num);
static int getScore(){return score;}
};
#endif //PVZ_GAME_H