3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
15 #include "ivancommon.h"
22 typedef truth (item::*sorter
) (ccharacter
*) const;
26 command (cchar
*name
, truth (*LinkedFunction
)(character
*), cchar
*Description
,
27 char Key1
, char Key2
, truth UsableInWilderness
, truth WizardModeFunction
=false);
29 truth (*GetLinkedFunction() const) (character
*) { return LinkedFunction
; }
31 cchar
*GetDescription () const { return Description
; }
32 const festring
&GetName () const { return mName
; }
34 char GetKey1 () const { return Key1
; }
35 char GetKey2 () const { return Key2
; }
36 void SetKeys (char k1
, char k2
) { Key1
= k1
; Key2
= k2
; }
37 truth
IsUsableInWilderness () const { return UsableInWilderness
; }
38 truth
IsWizardModeFunction () const { return WizardModeFunction
; }
42 truth (*LinkedFunction
) (character
*);
46 truth UsableInWilderness
;
47 truth WizardModeFunction
;
55 static void ConfigureKeys ();
56 static void SaveKeys (truth forced
=false);
58 static command
*GetCommand (int idx
) { return (idx
>= 0 && idx
< (int)mCommands
.size()) ? mCommands
[idx
] : 0; }
60 static truth
Consume (character
*, cchar
*, sorter
);
62 static void RegisterCommand (command
*);
65 //static command *Command[];
66 static std::vector
<command
*> mCommands
;