20 #ifndef __MINIGAMEMANAGER_H 21 #define __MINIGAMEMANAGER_H 26 #include <csutil/weakref.h> 172 bool Load(csString &responseString);
178 void AddPlayer(
Client* client);
181 void RemovePlayer(
Client* client);
184 bool IsValidToUpdate(
Client* client)
const;
195 void Send(uint32_t clientID, uint32_t modOptions);
207 bool GameSessionActive(
void);
222 bool IsSessionPublic(
void);
267 csString winnerScript;
282 int8_t col1, int8_t row1, int8_t state1,
283 int8_t col2=-1, int8_t row2=-1, int8_t state2=-1);
315 void ResetAllGameSessions(
void);
326 void HandleStartGameRequest(
Client* client);
329 void HandleStopGameRequest(
Client* client);
338 int16_t ParseGameboardOptions(
psString optionsStr);
MinigamePlayer * nextPlayerToMove
pointer to next player to move
bool GetSessionReset(void)
Gets reset status of session.
const csString & GetName() const
Returns the session name.
int blackOrWhite
identifies colour pieces for player TODO this is temp
MinigamePlayer * nextMover
point to next player to move
uint16_t options
Game options.
void SetSessionReset(void)
Sets session to be reset (i.e. deleted and restarted next play)
Structure to hold player data.
csWeakRef< gemObject > actionObject
Action location object.
uint32_t id
The game session ID (equals to the action location ID)
Wrapper class for game board.
csHash< psMiniGameBoardDef *, csString > gameBoardDef
Minigame board definitions by name.
The structure of 1 queue entry (pointer to a message)
Game board definition class.
csArray< uint32_t > watchers
Watchers.
csString name
The game session name.
normally 2 or more player mini-game
csPDelArray< MinigamePlayer > players
Minigame players.
const uint32_t GetID() const
Returns the game session ID.
csHash< psMiniGameSession *, uint32_t > playerSessions
Maps players to game sessions for quicker access.
bool toReset
if game session marked for reset
MiniGameManager * manager
Game manager.
csPDelArray< psMiniGameSession > sessions
Game sessions.
This class collects data of a netclient.
uint16_t GetOptions() const
Returns the game options.
int idleCounter
Idle counter for the player with black pieces.
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision det...
Handles minigame sessions.
Message from the client with a minigame board update.
uint8_t currentCounter
Current message counter for versionin.
psMiniGameBoard gameBoard
The current game board.
This class generically allows objects to be notified when a gemObject is removed. ...
Implements one minigame session.
Provides a manager to facilitate subscriptions.