OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
games.game_launcher.GameLauncher Class Reference

Launch a configured game as a child process. More...

Inheritance diagram for games.game_launcher.GameLauncher:
games.game_launcher_if.GameLauncherIf

Public Member Functions

int|None process_id (self)
 Return the active child process id, if one exists.
 
None launch (self, GameDefinition game, Sequence[str]|None command=None, Callable[[], None]|None on_exit=None)
 Launch a game as a managed child process.
 
None stop (self)
 Stop the currently running game, if any.
 
bool is_running (self)
 Return whether the launched game process is alive.
 

Detailed Description

Launch a configured game as a child process.

Member Function Documentation

◆ is_running()

bool games.game_launcher.GameLauncher.is_running (   self)

Return whether the launched game process is alive.

Returns
True while the launched game process is alive, otherwise False.

Reimplemented from games.game_launcher_if.GameLauncherIf.

◆ launch()

None games.game_launcher.GameLauncher.launch (   self,
GameDefinition  game,
Sequence[str] | None   command = None,
Callable[[], None] | None   on_exit = None 
)

Launch a game as a managed child process.

Parameters
gameConfigured game definition to launch.
commandOptional concrete command override. When omitted, use the command from the game definition.
on_exitOptional callback invoked after the child process exits.

Reimplemented from games.game_launcher_if.GameLauncherIf.


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