Public Member Functions | Protected Member Functions | Protected Attributes

MultiplayerMatch Class Reference

Multiplayer match class. More...

#include <MultiplayerMatch.h>

Inheritance diagram for MultiplayerMatch:
Match

List of all members.

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

Netm_net
 Net for sending data.
HttpHandlerm_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?

Detailed Description

Multiplayer match class.

Multiplayer game. Sends data via Marmalade's sockets.


Constructor & Destructor Documentation

MultiplayerMatch::MultiplayerMatch (  ) 

Constructor.

Create a new multiplayer match.

MultiplayerMatch::~MultiplayerMatch (  )  [override]

Destructor.

Destroy the match and release all associated memory.


Member Function Documentation

void MultiplayerMatch::HandleLobby ( CIw2DFont *  font  ) 

Handle lobby.

Update the lobby.

Parameters:
[in] font Font for rendering text.
void MultiplayerMatch::HandleUpdate ( double  deltaTime,
CIw2DFont *  font 
)

Handle update.

Parameters:
[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.

Parameters:
[in] pos The vector position.
Returns:
char* The position as a char array.
CIwFVec2 MultiplayerMatch::StringToPosition ( std::string  pos  ) 

String to position.

Convert a string (presumably in the right format) to a position.

Parameters:
[in] pos The position as a string.
Returns:
Vector2 The position.
int MultiplayerMatch::Update ( double  deltaTime,
CIw2DFont *  font 
) [override, virtual]

Update.

Update the match and handle user input (if any).

Parameters:
[in] deltaTime Time since the last update.
[in] font Font for rendering text.
Returns:
int representing new game state (if any).

Implements Match.


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