Bomberman Multiplayer
Authoritative multiplayer networking layer for Bomberman.
Loading...
Searching...
No Matches
bomberman::Game Class Reference

Public Member Functions

 Game (const std::string &windowName, int windowWidth, int windowHeight, net::NetClient *inNetClient=nullptr, uint16_t serverPort=net::kDefaultServerPort, bool mute=false, MultiplayerClientConfig multiplayerConfig={})
 Constructs game runtime and initializes SDL subsystems.
 
 ~Game ()
 Releases runtime resources and shuts down SDL subsystems.
 
void run ()
 Runs the main loop until stop() is requested.
 
void stop ()
 Requests the main loop to stop.
 
int getWindowWidth () const
 Returns current window width in pixels.
 
int getWindowHeight () const
 Returns current window height in pixels.
 
SDL_Renderer * getRenderer () const
 Returns the SDL renderer.
 
SceneManagergetSceneManager () const
 Returns the scene manager.
 
AssetManagergetAssetManager () const
 Returns the asset manager.
 
net::NetClientgetNetClient () const
 Returns the network client, or nullptr if not in multiplayer mode.
 
bool tryGetLatestSnapshot (net::MsgSnapshot &out) const
 Fills out with the most recent server snapshot and returns true.
 
uint16_t getServerPort () const
 Returns the server port (from CLI or default).
 
const MultiplayerClientConfiggetMultiplayerClientConfig () const
 Returns the multiplayer client configuration used for this run.
 
bool isPredictionEnabled () const
 Returns true when local multiplayer prediction is enabled.
 
bool isRemoteSmoothingEnabled () const
 Returns true when remote smoothing/interpolation is enabled.
 
void suppressBombInputUntilReleased ()
 Suppresses bomb input until the space key is released once.
 
void disconnectNetClientIfActive (bool blockUntilComplete=true)
 Disconnects the multiplayer client if one is active.
 

Constructor & Destructor Documentation

◆ Game()

bomberman::Game::Game ( const std::string &  windowName,
int  windowWidth,
int  windowHeight,
net::NetClient inNetClient = nullptr,
uint16_t  serverPort = net::kDefaultServerPort,
bool  mute = false,
MultiplayerClientConfig  multiplayerConfig = {} 
)

Constructs game runtime and initializes SDL subsystems.

Parameters
windowNameWindow title.
windowWidthInitial window width.
windowHeightInitial window height.
inNetClientOptional multiplayer client (not owned).
serverPortServer port from CLI or default config.
muteStarts the client with all audio output silenced when true.
multiplayerConfigStartup config for client-side netcode behavior.

Member Function Documentation

◆ tryGetLatestSnapshot()

bool bomberman::Game::tryGetLatestSnapshot ( net::MsgSnapshot out) const

Fills out with the most recent server snapshot and returns true.

Returns false if not in multiplayer mode, or not yet connected.


The documentation for this class was generated from the following files: