00001 #ifndef _HUD_H_ 00002 #define _HUD_H_ 00003 00004 #include <sstream> 00005 using namespace std; 00006 00007 #include "HudBase.h" 00008 #include "HudChat.h" 00009 #include "HudMessage.h" 00010 #include "HudMoney.h" 00011 #include "HudOptions.h" 00012 #include "Object.h" 00013 00018 class Hud : public Object, public HudBase 00019 { 00020 public: 00021 Hud(); 00022 virtual ~Hud(); 00023 00024 virtual void draw(); 00025 00026 void setMoney(int t) { _money->setMoney(t); } 00027 00028 void serverMessage(string message) { _hudChat->addMessage(message); } 00029 void clearChat() { _hudChat->clearChat(); } 00030 void addChat(unsigned char c) { _hudChat->addChat(c); } 00031 void popChat() { _hudChat->popChat(); } 00032 string getChat() { return _hudChat->getChat(); } 00033 00034 void setOptions(vector <string > options) { _hudOptions->setOptions(options); } 00035 void nextDisplayOption() { _hudOptions->nextSelection(); } 00036 void previousDisplayOption() { _hudOptions->previousSelection(); } 00037 int getDisplayOptions() { return _hudOptions->getSelection(); } 00038 void clearDisplayOptions() { _hudOptions->clearOptions(); } 00039 bool hasDisplayOptions() { return _hudOptions->hasOptions(); } 00040 00041 void setTimeoutMessage(string str, double timeout) { _hudMessage->addTimeoutMessage(str, timeout); } 00042 00043 protected: 00044 vector < HudBase * > _hudObjects; 00045 // hud parts 00046 HudMoney *_money; 00047 HudOptions *_hudOptions; 00048 HudMessage *_hudMessage; 00049 HudChat *_hudChat; 00050 }; 00051 00052 #endif