diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-05-29 07:25:38 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-05-29 07:25:38 +0000 |
| commit | 72c06a258940696093f255fb1061beb58e1cdd0b (patch) | |
| tree | 36b9a7712eec2d4f07837eab9c38ef1c5af85319 /src/game/client/components/voting.hpp | |
| parent | e56feb597bc743677633432f77513b02907fd169 (diff) | |
| download | zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.tar.gz zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.zip | |
copied refactor to trunk
Diffstat (limited to 'src/game/client/components/voting.hpp')
| -rw-r--r-- | src/game/client/components/voting.hpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/game/client/components/voting.hpp b/src/game/client/components/voting.hpp deleted file mode 100644 index e04e1840..00000000 --- a/src/game/client/components/voting.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#include <game/client/component.hpp> -#include <game/client/ui.hpp> -#include <engine/e_memheap.h> - -class VOTING : public COMPONENT -{ - HEAP *heap; - - 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; - - void clearoptions(); - void callvote(const char *type, const char *value); - -public: - - struct VOTEOPTION - { - VOTEOPTION *next; - VOTEOPTION *prev; - char command[1]; - }; - VOTEOPTION *first; - VOTEOPTION *last; - - VOTING(); - virtual void on_reset(); - virtual void on_console_init(); - virtual void on_message(int msgtype, void *rawmsg); - virtual void on_render(); - - void render_bars(CUIRect bars, bool text); - - void callvote_kick(int client_id); - void callvote_option(int option); - - void vote(int v); // -1 = no, 1 = yes - - int seconds_left() { return (closetime - time_get())/time_freq(); } - 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; -}; - |