ScummVM API documentation
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#ifndef SCUMM_INSANE_MORTIMER_SCORES_H
22#define SCUMM_INSANE_MORTIMER_SCORES_H
23
24#include "common/keyboard.h"
25#include "scumm/insane/mortimer/text.h"
26
27namespace Common {
28class SaveFileManager;
29}
30
31namespace Scumm {
32
34 uint32 stone, initial, castle;
35};
36
37const MortimerScoring &mortimerScoring(uint flightDifficulty, uint riddleDifficulty);
38
40public:
41 bool load(Common::SaveFileManager &saveFileMan, const Common::String &fileName);
42 void start(uint32 score, bool allowEntry);
43 bool handleKey(const Common::KeyState &key);
44 bool save(Common::SaveFileManager &saveFileMan, const Common::String &fileName);
45 bool enteringName() const { return _enteringName; }
46 void draw(Graphics::Surface &screen, uint32 time) const;
47
48private:
49 struct Entry {
50 char name[20];
51 uint32 score;
52 };
53
54 bool read(Common::SeekableReadStream &stream);
55 Common::String ranking(uint32 score) const;
56 void drawText(Graphics::Surface &screen, const Common::String &text, int x, int y, byte color,
57 Graphics::TextAlign align) const;
58
59 Entry _entries[10];
60 MortimerFont _font;
62 uint32 _score = 0;
63 int _selected = -1;
64 bool _enteringName = false, _didNotQualify = false;
65};
66
67} // End of namespace Scumm
68
69#endif
Definition: savefile.h:142
Definition: stream.h:745
Definition: str.h:59
Definition: text.h:30
Definition: scores.h:39
Definition: text.h:44
TextAlign
Definition: font.h:48
Definition: algorithm.h:29
Definition: actor.h:30
Definition: keyboard.h:294
Definition: surface.h:67
Definition: scores.h:33