src/Graphics/GameView.hh
author Tero Marttila <terom@fixme.fi>
Wed, 21 Jan 2009 01:57:24 +0200
branchnew_graphics
changeset 410 41fd46cffc52
child 411 106aaf6eadfe
permissions -rw-r--r--
start working out the Graphics/* code, this is a long way from compiling, let alone working
#ifndef GRAPHICS_GAME_VIEW_HH
#define GRAPHICS_GAME_VIEW_HH

#include "Drawable.hh"
#include "../GameState.hh"

namespace graphics
{

/**
 * This is the main in-game view, which is what the player sees when they are playing
 */    
class GameView : public Drawable {
protected:
    /** The GameState that we're drawing */
    GameState &state;
    
    /** The player that we are controlling, if any */
    LocalPlayer *player;

public:
    /**
     * Constructed once the game is running
     */ 
    GameView (GameState &state, LocalPlayer *player) :
        state(state), player(player)
    {

    }

    /**
     * Set a player where none was set before
     */
    void setPlayer (LocalPlayer *player) {
        assert(!this->player);
        
        // remember it
        this->player = player;
    }
    
    /**
     * Draw this view onto the given display
     */
    void draw (Display *display);
};

}
#endif