-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jornada.h
84 lines (60 loc) · 1.55 KB
/
Jornada.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
74
75
76
77
78
79
80
81
82
83
#pragma once
#include "../Scenes/Scene.h"
#include "./tmxlite/Map.hpp"
#include "./tmxlite/Layer.hpp"
#include "./tmxlite/TileLayer.hpp"
#include "./tmxlite/ObjectGroup.hpp"
#include "./tmxlite/Tileset.hpp"
#include "../Control/Camera.h"
#include <unordered_map>
using namespace std;
using namespace tmx;
using uint = unsigned int;
class Player;
class Mueble;
class NetworkManager;
struct MapInfo {
Map* mTilemap;
string mRuta;
int mFilas, mColumnas;
int mAnchoTile, mAltoTile;
int mAnchoFondo, mAltoFondo;
unordered_map<uint, Texture*> mTilesets;
MapInfo() {
mTilemap = nullptr;
mRuta = "";
mFilas = mColumnas = mAnchoTile = mAltoTile = 0;
}
~MapInfo() {
if (mTilemap != nullptr)
delete mTilemap;
}
};
class Jornada : public Scene
{
const float LERP_INTERPOLATION = 0.2f;
MapInfo mMapInfo;
list<double> mPuntuacionesComandas;
double mPuntuacionTotal;
RedactaComandabutton* mRedactaBut;
Vector2D<int> mTamRestaurante = Vector2D<int>(0, 1216);
Vector2D<double> mPositionCamarero;
Vector2D<double> mPositionCocinera;
int mNumJornada = 0;
bool mHost;
int mIdCount = 0;
public:
Jornada(Game* mGame, string tilemap, int numeroJornada, bool cocinera = true);
~Jornada();
void handleInput(bool& exit) override;
void update() override;
void addPuntuaciones(double puntosComanda) override;
void refresh() override;
void mediaPuntuaciones();
void loadMap(string const& path);
void togglePause();
int getNumJornada() { return mNumJornada; }
double getPunctuationJornada() {
mediaPuntuaciones();
return mPuntuacionTotal; }
};