Multiplayer match class. More...
#include <MultiplayerMatch.h>
Public Member Functions | |
MultiplayerMatch () | |
~MultiplayerMatch () override | |
int | Update (double deltaTime, CIw2DFont *font) override |
void | HandleLobby (CIw2DFont *font) |
void | HandleUpdate (double deltaTime, CIw2DFont *font) |
CIwFVec2 | StringToPosition (std::string pos) |
char * | PositionToString (CIwFVec2 pos) |
Protected Member Functions | |
void | ObtainIP () |
void | InitialiseNet () |
Protected Attributes | |
Net * | m_net |
Net for sending data. | |
HttpHandler * | m_handler |
Http handler for post and get requests. | |
char * | m_ip |
Ip address. | |
bool | m_hasIp |
Has my ip been retrieved yet? | |
bool | m_wasDiscLaunched |
Has a disc been launched this turn? |
Multiplayer match class.
Multiplayer game. Sends data via Marmalade's sockets.
MultiplayerMatch::MultiplayerMatch | ( | ) |
Constructor.
Create a new multiplayer match.
MultiplayerMatch::~MultiplayerMatch | ( | ) | [override] |
Destructor.
Destroy the match and release all associated memory.
void MultiplayerMatch::HandleLobby | ( | CIw2DFont * | font | ) |
Handle lobby.
Update the lobby.
[in] | font | Font for rendering text. |
void MultiplayerMatch::HandleUpdate | ( | double | deltaTime, | |
CIw2DFont * | font | |||
) |
Handle update.
[in] | deltaTime | Time since the last update. |
[in] | font | Font for rendering text. |
void MultiplayerMatch::InitialiseNet | ( | ) | [protected] |
Initialise net.
Initialise net and bind ports.
void MultiplayerMatch::ObtainIP | ( | ) | [protected] |
Get my ip.
Obtains the player's ip address.
char * MultiplayerMatch::PositionToString | ( | CIwFVec2 | pos | ) |
Position to string.
Convert a vetor2 position to a char array.
[in] | pos | The vector position. |
CIwFVec2 MultiplayerMatch::StringToPosition | ( | std::string | pos | ) |
String to position.
Convert a string (presumably in the right format) to a position.
[in] | pos | The position as a string. |
int MultiplayerMatch::Update | ( | double | deltaTime, | |
CIw2DFont * | font | |||
) | [override, virtual] |
Update.
Update the match and handle user input (if any).
[in] | deltaTime | Time since the last update. |
[in] | font | Font for rendering text. |
Implements Match.