new graphics code compiles... no, it doesn't work yet
#ifndef GRAPHICS_GAME_VIEW_HH
#define GRAPHICS_GAME_VIEW_HH
#include "Drawable.hh"
#include "PlayerInfoView.hh"
#include "MessageView.hh"
#include "../GameState.hh"
#include "../Input.hh"
namespace graphics
{
/**
* This is the main in-game view, which is what the player sees when they are playing
*/
class GameView : public View {
protected:
/** The GameState that we're drawing */
GameState &state;
/** The player that we are controlling, if any */
LocalPlayer *player;
/**
* The PlayerInfo view is built once we have a player
*/
PlayerInfoView *info_view;
/**
* The message list view
*/
MessageView message_view;
/**
* Input flags
*/
GuiInput flags;
public:
/**
* Constructed once the game is running
*/
GameView (GameState &state, LocalPlayer *player);
/**
* Set a player where none was set before
*/
void setPlayer (LocalPlayer *player);
private:
/**
* Calculate new area for the info_view based on our own area
*/
PixelArea getInfoViewArea (void) {
return PixelArea(0, area.bottom - 100, area.right, area.bottom);
}
/**
* Calculate new area for the message view
*/
PixelArea getMessageViewArea (void) {
return PixelArea(400, area.bottom - 100, area.right, area.bottom);
}
public:
/**
* Draw this view onto the given display
*/
virtual void draw (Display &display);
/**
* Resize sub-views
*/
virtual void resize (const PixelArea &new_area);
};
}
#endif