vrheights
annotate 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 |
rev | line source |
---|---|
nuclear@7 | 1 #ifndef GAME_VAR_H_ |
nuclear@7 | 2 #define GAME_VAR_H_ |
nuclear@7 | 3 |
nuclear@7 | 4 #include <string> |
nuclear@7 | 5 #include <list> |
nuclear@7 | 6 |
nuclear@7 | 7 struct GameVariable { |
nuclear@7 | 8 enum { NUMBER, BOOL, STR } type; |
nuclear@7 | 9 std::string name, val; |
nuclear@7 | 10 float num_val; |
nuclear@7 | 11 bool bool_val; |
nuclear@7 | 12 |
nuclear@7 | 13 GameVariable(); |
nuclear@7 | 14 std::string to_str() const; |
nuclear@7 | 15 }; |
nuclear@7 | 16 |
nuclear@7 | 17 void set_gvar(const GameVariable &var); |
nuclear@7 | 18 void set_gvar_str(const char *name, const char *val); |
nuclear@7 | 19 void set_gvar_num(const char *name, float val); |
nuclear@7 | 20 void set_gvar_bool(const char *name, bool val); |
nuclear@7 | 21 void set_gvar_parse(const char *name, const char *val); |
nuclear@7 | 22 |
nuclear@7 | 23 GameVariable &get_gvar(const char *name); |
nuclear@7 | 24 const char *get_gvar_str(const char *name); |
nuclear@7 | 25 float get_gvar_num(const char *name); |
nuclear@7 | 26 bool get_gvar_bool(const char *name); |
nuclear@7 | 27 |
nuclear@7 | 28 bool have_gvar(const char *name); |
nuclear@7 | 29 |
nuclear@7 | 30 std::list<std::string> get_gvar_list(); |
nuclear@7 | 31 |
nuclear@7 | 32 #endif // GAME_VAR_H_ |