Public Member Functions | Protected Attributes | Static Protected Attributes

HighScoreTable Class Reference

Highscore table. More...

#include <HighScoreTable.h>

Inheritance diagram for HighScoreTable:
Menu

List of all members.

Public Member Functions

 HighScoreTable ()
 ~HighScoreTable ()
int Update ()
void Draw () override
void SplitResult (char *arr)
void DrawResult ()

Protected Attributes

CIwFVec2 m_position
 Position of the highscore table (top left corner).
CIw2DImage * m_background
 Background image for the table.
CIw2DImage * m_backButton
 Image for the back button.
CIwFVec2 m_backButtonPosition
 Position of the back button.
CIwFVec2 m_backButtonDimensions
 Dimensions of the back button.
HttpHandlerm_http
 Http object for getting scores.
CIw2DFont * m_font
 Font for drawing scores.
char * m_scoreResult
 Result of the http get score request.
bool m_hasScores
 Has the request got the scores yet?
std::vector< std::string > m_tableElements
 Scores and usernames as strings for easy rendering.
CIwFVec2 m_connectionTextPos
 Position for "Connecting" text.
CIwFVec2 m_textDisplayRectangle
 Size of text drawing area.
CIwFVec2 m_nameDrawPos
 Position for rendering usernames.
CIwFVec2 m_scoreDrawPos
 Position for rendering scores.

Static Protected Attributes

static const int m_lineSeparation = 25
 Vertical distance between the lines of text in the table.

Detailed Description

Highscore table.

Highscore table. Performs Http GET request and displays the result.


Constructor & Destructor Documentation

HighScoreTable::HighScoreTable (  ) 

Constructor.

Create the table.

HighScoreTable::~HighScoreTable (  ) 

Destructor.

Destory the table and release all associated memory.


Member Function Documentation

void HighScoreTable::Draw (  )  [override, virtual]

Draw.

Render the table.

Reimplemented from Menu.

void HighScoreTable::DrawResult (  ) 

Draw result.

Renders the strings.

void HighScoreTable::SplitResult ( char *  arr  ) 

Split result.

Split the Http GET result (char*) into an array of strings.

Parameters:
[in] arr the http result.
int HighScoreTable::Update (  ) 

Update.

Check for user input and act on it.

Returns:
int representing user action.

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations