#include <EndMenu.h>
Public Member Functions | |
EndMenu (int matchResult, float matchTime) | |
~EndMenu () | |
int | Update () |
void | Draw () |
void | PostScore () |
Protected Types | |
enum | Result { REDWIN = 1, YELLOWWIN = 2, DRAW = 3 } |
Possible match results. | |
Protected Attributes | |
CIwFVec2 | m_position |
Position of the menu (top left corner). | |
CIw2DImage * | m_background |
Background image for the menu. | |
CIw2DImage * | m_quitButton |
Image for the Quit button. | |
CIw2DImage * | m_restartButton |
Image for the Restart button. | |
CIw2DImage * | m_uploadButton |
Image for the Post Score button. | |
CIwFVec2 | m_quitButtonPosition |
Position of the Quit button (top left corner). | |
CIwFVec2 | m_restartButtonPosition |
Position of the Restart button (top left corner). | |
CIwFVec2 | m_uploadButtonPosition |
Position of the Post Score button (top left corner). | |
HttpHandler * | m_http |
Http object for posting scores to the server. | |
int | m_result |
Result of the match (win, loss, draw). | |
float | m_time |
Duration of the match. | |
Static Protected Attributes | |
static const int | m_buttonDiameter = 100 |
Diameter of the buttons on the menu. | |
static const int | m_buttonRadius = 50 |
Radius of the buttons on the menu. |
End Menu class.
Menu to be displayed at the end of a match. Allows players to quit, restart, and post scores to the server.
EndMenu::EndMenu | ( | int | matchResult, | |
float | matchTime | |||
) |
Constructor.
Create a new End Menu.
[in] | matchResult | Result of the match. Determines what the menu will say (win, lose, draw). |
[in] | matchTime | Duration of the match. Used for posting to the highscore database. |
EndMenu::~EndMenu | ( | ) |
Destructor.
Destroys the menu and releases all associated memory.
void EndMenu::Draw | ( | ) |
Draw.
Render the menu and the buttons.
void EndMenu::PostScore | ( | ) |
Post score.
Post the match time to the server (HTTP Post).
int EndMenu::Update | ( | ) |
Play a sound.
Play a sound effect file (plays only once).