Cosmetic changes only.

This commit is contained in:
hiker 2016-03-16 09:49:30 +11:00
parent 07048d62fe
commit 90f82494f7

View File

@ -8,62 +8,66 @@ class STKPeer;
class ClientLobbyRoomProtocol : public LobbyRoomProtocol
{
public:
ClientLobbyRoomProtocol(const TransportAddress& server_address);
virtual ~ClientLobbyRoomProtocol();
private:
void newPlayer(Event* event);
void disconnectedPlayer(Event* event);
void connectionAccepted(Event* event); //!< Callback function on connection acceptation
void connectionRefused(Event* event); //!< Callback function on connection refusal
void kartSelectionRefused(Event* event);
void kartSelectionUpdate(Event* event);
void startGame(Event* event);
void startSelection(Event* event);
void raceFinished(Event* event);
// race votes
void playerMajorVote(Event* event);
void playerRaceCountVote(Event* event);
void playerMinorVote(Event* event);
void playerTrackVote(Event* event);
void playerReversedVote(Event* event);
void playerLapsVote(Event* event);
void requestKartSelection(uint8_t player_id,
const std::string &kart_name);
void voteMajor(uint8_t player_id, uint32_t major);
void voteRaceCount(uint8_t player_id, uint8_t count);
void voteMinor(uint8_t player_id, uint32_t minor);
void voteTrack(uint8_t player_id, const std::string &track,
uint8_t track_nb = 0);
void voteReversed(uint8_t player_id, bool reversed, uint8_t track_nb = 0);
void voteLaps(uint8_t player_id, uint8_t laps, uint8_t track_nb = 0);
void leave();
TransportAddress m_server_address;
virtual bool notifyEvent(Event* event);
virtual bool notifyEventAsynchronous(Event* event);
virtual void setup();
virtual void update();
virtual void asynchronousUpdate() {}
STKPeer* m_server;
protected:
void newPlayer(Event* event);
void disconnectedPlayer(Event* event);
void connectionAccepted(Event* event); //!< Callback function on connection acceptation
void connectionRefused(Event* event); //!< Callback function on connection refusal
void kartSelectionRefused(Event* event);
void kartSelectionUpdate(Event* event);
void startGame(Event* event);
void startSelection(Event* event);
void raceFinished(Event* event);
// race votes
void playerMajorVote(Event* event);
void playerRaceCountVote(Event* event);
void playerMinorVote(Event* event);
void playerTrackVote(Event* event);
void playerReversedVote(Event* event);
void playerLapsVote(Event* event);
enum STATE
{
NONE,
LINKED,
REQUESTING_CONNECTION,
CONNECTED, // means in the lobby room
KART_SELECTION, // Start kart selection, then go to next state
SELECTING_KARTS, // in the network kart selection screen
PLAYING, // racing
RACE_FINISHED, // race result shown
DONE,
EXITING
};
TransportAddress m_server_address;
STKPeer* m_server;
/** The state of the finite state machine. */
STATE m_state;
public:
ClientLobbyRoomProtocol(const TransportAddress& server_address);
virtual ~ClientLobbyRoomProtocol();
void requestKartSelection(uint8_t player_id,
const std::string &kart_name);
void voteMajor(uint8_t player_id, uint32_t major);
void voteRaceCount(uint8_t player_id, uint8_t count);
void voteMinor(uint8_t player_id, uint32_t minor);
void voteTrack(uint8_t player_id, const std::string &track,
uint8_t track_nb = 0);
void voteReversed(uint8_t player_id, bool reversed, uint8_t track_nb = 0);
void voteLaps(uint8_t player_id, uint8_t laps, uint8_t track_nb = 0);
void leave();
virtual bool notifyEvent(Event* event);
virtual bool notifyEventAsynchronous(Event* event);
virtual void setup();
virtual void update();
virtual void asynchronousUpdate() {}
enum STATE
{
NONE,
LINKED,
REQUESTING_CONNECTION,
CONNECTED, // means in the lobby room
KART_SELECTION,
SELECTING_KARTS, // in the network kart selection screen
PLAYING,
RACE_FINISHED,
DONE,
EXITING
};
STATE m_state;
};
#endif // CLIENT_LOBBY_ROOM_PROTOCOL_HPP