diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-09-24 14:47:03 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-09-24 14:47:03 +0000 |
| commit | 917ebc17c617dfd27e4e997dce713cb1dfb6cfdc (patch) | |
| tree | 11d85f18ef289de3de322bed5274dc616c23ac45 /src/game/client/components/voting.hpp | |
| parent | 2f28978237f0ead749a39229f1c683df63d34871 (diff) | |
| download | zcatch-917ebc17c617dfd27e4e997dce713cb1dfb6cfdc.tar.gz zcatch-917ebc17c617dfd27e4e997dce713cb1dfb6cfdc.zip | |
begun the work on voting
Diffstat (limited to 'src/game/client/components/voting.hpp')
| -rw-r--r-- | src/game/client/components/voting.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/game/client/components/voting.hpp b/src/game/client/components/voting.hpp new file mode 100644 index 00000000..6f518d10 --- /dev/null +++ b/src/game/client/components/voting.hpp @@ -0,0 +1,39 @@ +#include <game/client/component.hpp> + +class VOTING : public COMPONENT +{ + /* + void render_goals(float x, float y, float w); + void render_spectators(float x, float y, float w); + void render_scoreboard(float x, float y, float w, int team, const char *title); + + static void con_key_scoreboard(void *result, void *user_data); + + bool active; + */ + + static void con_callvote(void *result, void *user_data); + static void con_vote(void *result, void *user_data); + + int64 closetime; + char description[512]; + char command[512]; + int voted; + +public: + VOTING(); + virtual void on_reset(); + virtual void on_console_init(); + virtual void on_message(int msgtype, void *rawmsg); + virtual void on_render(); + + void vote(int v); // -1 = no, 1 = yes + + bool is_voting() { return closetime != 0; } + int taken_choice() const { return voted; } + const char *vote_description() const { return description; } + const char *vote_command() const { return command; } + + int yes, no, pass, total; +}; + |