-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamemanager.h
50 lines (33 loc) · 1.1 KB
/
gamemanager.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
#ifndef GAMEMANAGER_H
#define GAMEMANAGER_H
#include "map.h"
#include "player.h"
#include "trainer.h"
#include "combatwindow.h"
class GameManager : public QObject
{
Q_OBJECT
private:
const int kNumWildPokemon = 20;
CombatWindow* combatWindow_;
Map* map_;
Player* player_;
std::unordered_map<Position, Trainer*, PositionHash> trainers_;
std::unordered_map<Position, Pokemon*, PositionHash> wildPokemon_;
Position currentBattlePos_;
std::pair<Position, Pokemon*>* CheckForWild(Position pos);
void StartBattle(std::pair<Position, Pokemon*>* pair);
void StartBattle(Trainer *trainer);
void RunPokeCenter();
public:
GameManager();
~GameManager();
Player* GetPlayer() const { return player_; }
std::vector<Tile*> GetMapTiles() const { return map_->GetAllTiles(); }
CombatWindow* GetCombatWindow() const { return combatWindow_; }
bool CheckTileValidity(Position pos, Direction dir) const { return map_->CheckAdjTileValid(pos, dir); }
void MovePlayer(Direction &dir);
public slots:
void CombatOver_slot(bool won);
};
#endif // GAMEMANAGER_H