xoreos  0.0.5
console.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_NWN_CONSOLE_H
26 #define ENGINES_NWN_CONSOLE_H
27 
28 #include <vector>
29 #include <map>
30 
31 #include "src/common/types.h"
32 #include "src/common/ustring.h"
33 
35 
36 namespace Engines {
37 
38 namespace NWN {
39 
40 class NWNEngine;
41 
42 class Console : public ::Engines::Console {
43 public:
44  Console(NWNEngine &engine);
45  ~Console();
46 
47 
48 private:
49  typedef std::map<Common::UString, int, Common::UString::iless> CampaignMap;
50 
51 
53 
54  // Caches
55  std::vector<Common::UString> _campaigns;
56  std::vector<Common::UString> _modules;
57  std::vector<Common::UString> _music;
58 
60 
61  size_t _maxSizeMusic;
62 
63 
64  // Updating the caches
65  void updateCaches();
66  void updateCampaigns();
67  void updateModules();
68  void updateAreas();
69  void updateMusic();
70 
71  // The commands
72  void cmdExitModule (const CommandLine &cl);
73  void cmdListCampaigns(const CommandLine &cl);
74  void cmdLoadCampaign (const CommandLine &cl);
75  void cmdListModules (const CommandLine &cl);
76  void cmdLoadModule (const CommandLine &cl);
77  void cmdListAreas (const CommandLine &cl);
78  void cmdGotoArea (const CommandLine &cl);
79  void cmdListMusic (const CommandLine &cl);
80  void cmdStopMusic (const CommandLine &cl);
81  void cmdPlayMusic (const CommandLine &cl);
82 };
83 
84 } // End of namespace NWN
85 
86 } // End of namespace Engines
87 
88 #endif // ENGINES_NWN_CONSOLE_H
std::vector< Common::UString > _campaigns
All known campaigns modules.
Definition: console.h:55
void cmdListMusic(const CommandLine &cl)
Definition: console.cpp:255
void cmdLoadModule(const CommandLine &cl)
Definition: console.cpp:210
void cmdPlayMusic(const CommandLine &cl)
Definition: console.cpp:264
void cmdListCampaigns(const CommandLine &cl)
Definition: console.cpp:181
void cmdListAreas(const CommandLine &cl)
Definition: console.cpp:228
void cmdExitModule(const CommandLine &cl)
Definition: console.cpp:175
std::vector< Common::UString > _music
All known music resources.
Definition: console.h:57
void cmdLoadCampaign(const CommandLine &cl)
Definition: console.cpp:187
Generic Aurora engines (debug) console.
Low-level type definitions to handle fixed width types portably.
void cmdStopMusic(const CommandLine &cl)
Definition: console.cpp:260
Unicode string handling.
CampaignMap _campaignModules
Mapping campaign module file -> campaign module name.
Definition: console.h:59
void cmdListModules(const CommandLine &cl)
Definition: console.cpp:205
NWNEngine * _engine
Definition: console.h:52
Console(NWNEngine &engine)
Definition: console.cpp:62
std::map< Common::UString, int, Common::UString::iless > CampaignMap
Definition: console.h:49
size_t _maxSizeMusic
Definition: console.h:61
void cmdGotoArea(const CommandLine &cl)
Definition: console.cpp:236
std::vector< Common::UString > _modules
All known modules.
Definition: console.h:56