vrheights
view src/game_var.h @ 7:0eca023ed909
- fixed the hmd-tracking / mouselook interaction
- added game variable system
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 01 Oct 2014 01:06:55 +0300 |
parents | |
children | 537db3079134 |
line source
1 #ifndef GAME_VAR_H_
2 #define GAME_VAR_H_
4 #include <string>
5 #include <list>
7 struct GameVariable {
8 enum { NUMBER, BOOL, STR } type;
9 std::string name, val;
10 float num_val;
11 bool bool_val;
13 GameVariable();
14 std::string to_str() const;
15 };
17 void set_gvar(const GameVariable &var);
18 void set_gvar_str(const char *name, const char *val);
19 void set_gvar_num(const char *name, float val);
20 void set_gvar_bool(const char *name, bool val);
21 void set_gvar_parse(const char *name, const char *val);
23 GameVariable &get_gvar(const char *name);
24 const char *get_gvar_str(const char *name);
25 float get_gvar_num(const char *name);
26 bool get_gvar_bool(const char *name);
28 bool have_gvar(const char *name);
30 std::list<std::string> get_gvar_list();
32 #endif // GAME_VAR_H_