ff411c04c57ced543090d87c267eb4c2afc239a6
[supertux.git] / data / scripts / console.nut
1 /**
2  * This script is loaded into the console script interpreter.
3  * You should define shortcuts and helper functions that are usefull for the
4  * console here
5  */
6
7 function flip()
8 {
9         Level.flip_vertically();
10 }
11
12 function finish()
13 {
14         Level.finish(true);
15 }
16
17 /**
18  * Display a list of functions in the roottable (or in the table specified)
19  */
20 function functions(...)
21 {
22         local obj = this;
23         if(vargc == 1)
24                 obj = vargv[0];
25         if(::type(obj) == "instance")
26                 obj = obj.getclass()
27
28         while(obj != null) {
29                 foreach(key, val in obj) {
30                         if(::type(val) == "function")
31                                 println(key);
32                 }
33                 obj = obj.parent;
34         }
35 }
36