Main event loop for a ConsoleForge application. More...
Public Member Functions | |
| void | SetTheme (Theme theme) |
| Update the active theme at runtime. Forces a re-render. | |
Static Public Member Functions | |
| static Task | Run (IModel model, ITerminal? terminal=null, Theme? theme=null, int targetFps=30, bool enableMouse=false) |
| Run the application asynchronously. | |
Properties | |
| ColorProfile | ColorProfile [get] |
| Detected color capability of the current terminal. | |
Main event loop for a ConsoleForge application.
Call Run to start the application. The method blocks until the model issues QuitMsg or the user force-quits. The terminal is guaranteed to be restored (raw mode exited, alternate screen exited) even if an unhandled exception occurs.
|
static |
Run the application asynchronously.
Returns when the model produces a QuitMsg.
| model | Initial model. Init() is called before the loop starts. |
| terminal | Optional terminal override. If null, a new AnsiTerminal is created. Pass a ConsoleForge.Testing.VirtualTerminal for testing. |
| theme | Theme to use. Defaults to Theme.Default. |
| targetFps | Target frames per second (1–60). Default 30. |