--- a/src/Graphics.hh Tue Jan 13 21:36:43 2009 +0200
+++ b/src/Graphics.hh Tue Jan 13 23:15:47 2009 +0200
@@ -9,6 +9,8 @@
#include "Engine.hh"
#include "Config.hh"
+#include "GameMessageView.hh"
+
#include <ClanLib/core.h>
#include <ClanLib/gl.h>
#include <ClanLib/display.h>
@@ -17,7 +19,7 @@
* This handles drawing the GameState with an appropriate camera view each frame, loading fonts, and currently,
* handling the input from Input to GameState.
*/
-class Graphics : public CL_DisplayWindow {
+class Graphics : public GameStateEventHandler, public CL_DisplayWindow {
private:
Engine &engine;
GameState &state;
@@ -36,6 +38,9 @@
// basic fonts
CL_Font simple_font;
+ // view components
+ GameMessageView message_view;
+
public:
Graphics (Engine &engine, GameState &state, PixelCoordinate resolution, bool fullscreen);
@@ -73,6 +78,11 @@
void on_update (TimeMS tick_length);
void draw_player_info(CL_GraphicContext *gc, Player *p);
+
+protected:
+ /* GameStateEventHandler */
+ virtual void on_player_joined (Player *p);
+ virtual void on_player_left (Player *p);
};
#endif /* GRAPHICS_HH */