Robot Devastation
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
rd::GameScreen Class Reference

A User Interface.

#include <GameScreen.hpp>

Inheritance diagram for rd::GameScreen:
rd::Screen

Public Member Functions

virtual bool init ()
 
virtual bool cleanup ()
 
virtual bool drawScreen (void *screen)
 
virtual bool update (const std::string &parameter, const std::string &value)
 
virtual bool update (const std::string &parameter, const Player &value)
 
virtual bool update (const std::string &parameter, const std::vector< Player > &value)
 
virtual bool update (const std::string &parameter, const std::vector< Target > &value)
 
virtual bool update (const std::string &parameter, const Weapon &value)
 
virtual bool update (const std::string &parameter, const Image &value)
 
- Public Member Functions inherited from rd::Screen
virtual int getHeight () const
 
virtual int getWidth () const
 

Static Public Attributes

static const std::string PARAM_CAMERA_FRAME = "camera_frame"
 
static const std::string PARAM_MYSELF = "myself"
 
static const std::string PARAM_PLAYERS = "players"
 
static const std::string PARAM_TARGETS = "targets"
 
static const std::string PARAM_WEAPON = "weapon"
 

Private Member Functions

bool drawUserUI (SDL_Surface *screen, const Player &user, const Weapon &weapon)
 
bool drawPlayerUI (SDL_Surface *screen, const Player &player, int x, int y)
 
bool drawTargetUI (SDL_Surface *screen, const Target &target, const Player &player_data)
 
bool drawScope (SDL_Surface *screen)
 

Private Attributes

bool update_required
 
SDL_Surface * camera_frame_surface
 
TTF_Font * player_font
 
TTF_Font * target_font
 
TTF_Font * weapon_font
 
Player myself
 
std::vector< Playerplayers
 
std::vector< Targettargets
 
Weapon current_weapon
 
Image camera_frame
 

Static Private Attributes

static const int SCREEN_WIDTH = 640
 
static const int SCREEN_HEIGHT = 480
 
static const int PLAYER_NAME_H = 15
 
static const int PLAYER_NAME_W = 65
 
static const int HEALTH_BAR_H = 10
 
static const int HEALTH_BAR_W = 80
 
static const int TARGET_THICKNESS = 2
 
static const int TARGET_TEXT_BOX_HEIGHT = 15
 
static const int TARGET_HEALTH_BAR_H = 5
 
static const int SCOPE_VERT_W = 4
 
static const int SCOPE_VERT_H = 50
 
static const int SCOPE_VERT_H_SPACE = 20
 
static const int SCOPE_HORIZ_W = 50
 
static const int SCOPE_HORIZ_H = 4
 
static const int SCOPE_HORIZ_W_SPACE = 20
 
static const int USER_HEALTH_MARGIN_X = 10
 
static const int USER_HEALTH_MARGIN_Y = 20
 
static const int USER_HEALTH_W = 20
 
static const int USER_HEALTH_BOTTOM_Y = 50
 
static const int AMMO_BAR_MARGIN_X =20
 
static const int AMMO_BAR_MARGIN_Y = 20
 
static const int AMMO_BAR_W = 200
 
static const int AMMO_BAR_H = 15
 
static const int WEAPON_NAME_WIDTH = 100
 
static const int WEAPON_NAME_HEIGHT = 10
 
static const int AMMO_TEXT_WIDTH = 50
 
static const int AMMO_TEXT_HEIGHT = 10
 
static const SDL_Color greencolor = {0, 255, 0, 0}
 
static const SDL_Color redcolor = {255, 0, 0, 0}
 
static const SDL_Color bluecolor = {0, 0, 255, 0}
 

Additional Inherited Members

- Protected Attributes inherited from rd::Screen
int h
 
int w
 

Member Data Documentation

◆ SCREEN_WIDTH

const int rd::GameScreen::SCREEN_WIDTH = 640
staticprivate
Todo:
Change screen constants to other thing

The documentation for this class was generated from the following files: