ScummVM API documentation
m_scores.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef QDENGINE_MINIGAMES_ADV_M_SCORES_H
23#define QDENGINE_MINIGAMES_ADV_M_SCORES_H
24
25#include "qdengine/minigames/adv/MinigameInterface.h"
26#include "qdengine/minigames/adv/RunTime.h"
27
28namespace QDEngine {
29
30MinigameInterface *createMinigameScores(MinigameManager *runtime);
31
32class Scores : public MinigameInterface {
33public:
34 Scores(MinigameManager *runtime);
35 ~Scores();
36
37 void quant(float dt);
38
39private:
40 struct GameData {
41 GameData(int gameNum, const MinigameData& inf) : num(gameNum), info(inf) {}
42 int num;
43 MinigameData info;
44 bool operator< (const GameData& rsh) const {
45 return info._sequenceIndex < rsh.info._sequenceIndex;
46 }
47 };
49 struct Level {
50 Level(int lvl = 0) : level(lvl) {}
51 int level;
52 Indexes games;
53 GameDatas data;
54 bool operator< (const Level& rsh) const {
55 return level < rsh.level;
56 }
57 };
59 Levels levels_;
60
61 const char *_currentLevel = nullptr;
62 const char *_bestScore = nullptr;
63 const char *_bestTime = nullptr;
64 const char *_lastScore = nullptr;
65 const char *_lastTime = nullptr;
66
67 const char *_timeFormat = nullptr;
68
69 QDObject _prev;
70 QDObject _next;
71 QDObject _gameBorder;
72 QDObject _outMaxLevel;
73
74 QDObjects _games;
75
76 int _preLevel = -1;
77 int _level = -1;
78
79 Coords _positions;
80
81 const char *getName(const char *begin, int idx) const;
82
83 MinigameManager *_runtime;
84};
85
86} // namespace QDEngine
87
88#endif // QDENGINE_MINIGAMES_ADV_M_SCORES_H
Definition: MinigameInterface.h:27
Definition: RunTime.h:94
Definition: common.h:34
Definition: m_scores.h:32
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: RunTime.h:53