ScummVM API documentation
codex.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 ULTIMA4_GAME_CODEX_H
23 #define ULTIMA4_GAME_CODEX_H
24 
25 #include "common/array.h"
26 
27 namespace Ultima {
28 namespace Ultima4 {
29 
30 enum CodexEjectCode {
31  CODEX_EJECT_NO_3_PART_KEY,
32  CODEX_EJECT_BAD_WOP,
33  CODEX_EJECT_NO_FULL_PARTY,
34  CODEX_EJECT_NO_FULL_AVATAR,
35  CODEX_EJECT_HONESTY,
36  CODEX_EJECT_COMPASSION,
37  CODEX_EJECT_VALOR,
38  CODEX_EJECT_JUSTICE,
39  CODEX_EJECT_SACRIFICE,
40  CODEX_EJECT_HONOR,
41  CODEX_EJECT_SPIRITUALITY,
42  CODEX_EJECT_HUMILITY,
43  CODEX_EJECT_TRUTH,
44  CODEX_EJECT_LOVE,
45  CODEX_EJECT_COURAGE,
46  CODEX_EJECT_BAD_INFINITY
47 };
48 
49 class Codex {
50 private:
51  Common::Array<Common::String> _virtueQuestions;
52  Common::Array<Common::String> _endgameText1;
53  Common::Array<Common::String> _endgameText2;
54 private:
58  int init();
59 
63  void deinit();
64 
69  void eject(CodexEjectCode code);
70 
74  void handleWOP(const Common::String &word);
75 
79  void handleVirtues(const Common::String &virtue);
80 
81  void handleInfinity(const Common::String &answer);
82 
86  void impureThoughts();
87 
91  static bool handleInfinityAnyKey(int key, void *data);
92  static bool handleEndgameAnyKey(int key, void *data);
93 public:
97  Codex();
98 
102  ~Codex();
103 
107  void start();
108 };
109 
110 extern Codex *g_codex;
111 
112 } // End of namespace Ultima4
113 } // End of namespace Ultima
114 
115 #endif
Definition: str.h:59
Definition: codex.h:49
Definition: detection.h:27