summaryrefslogtreecommitdiff
path: root/src/functionkeys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/functionkeys.cpp')
-rw-r--r--src/functionkeys.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/functionkeys.cpp b/src/functionkeys.cpp
new file mode 100644
index 0000000..12c1098
--- /dev/null
+++ b/src/functionkeys.cpp
@@ -0,0 +1,32 @@
1#include "functionkeys.h"
2
3#include "gamestate.h"
4
5#include <bu/sio.h>
6using namespace Bu;
7
8FunctionKeys::FunctionKeys()
9{
10}
11
12FunctionKeys::~FunctionKeys()
13{
14}
15
16void FunctionKeys::call( class GameState &gState )
17{
18 Variable vDict = gState.popDeref();
19
20 if( vDict.getType() != Variable::tDictionary )
21 throw Bu::ExceptionBase("Parameter to keys must be a dictionary.");
22
23 Variable vLst( Variable::tList );
24 for( Variable::VariableHash::const_iterator i = vDict.getHash().begin();
25 i; i++ )
26 {
27 vLst += i.getKey();
28 }
29
30 gState.push( vLst );
31}
32