Removed a global variable
[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 function println(val)
18 {
19         print(val);
20         print("\n");
21 }
22
23 /**
24  * Display a list of functions in the roottable (or in the table specified)
25  */
26 function functions(...)
27 {
28         local obj = this;
29         if(vargc == 1)
30                 obj = vargv[0];
31         if(::type(obj) == "instance")
32                 obj = obj.getclass()
33
34         while(obj != null) {
35                 foreach(key, val in obj) {
36                         if(::type(val) == "function")
37                                 println(key);
38                 }
39                 obj = obj.parent;
40         }
41 }
42
43