Expand description
What a game on the short path names (ADR-0036), and the start types a game names when it leaves it. Anything else is named by its module’s path.
Re-exports§
pub use crate::AppInfo;pub use crate::BasicGame;pub use crate::Card;pub use crate::Look;pub use crate::Setup;pub use crate::Start;
Structs§
- Basic
Data - A game’s data on the short path: what the engine reads from the
standard files, the files themselves and the game’s own part
T. Its actions areA(most simplyUiAction), its colours the engine’s. - Bundle
- The layers a game reads its files from.
- Cell
- One console cell: a glyph with foreground and background colours.
- Console
Spec - A console’s size:
cols × rowscells ofcell_w × cell_hlogical pixels. The frame (GlyphBuffer) keeps the spec it was made with; the game picks one when it starts (game ADR-0070 §6). - Content
Error - One problem found while loading or validating an asset. Build it with
ContentError::newand its methods (ADR-0039). - Ctx
- Resources shared by every screen: the engine’s, and the game’s in
game. - Frame
Input - One frame’s input as a screen sees it.
- Game
- Owns the screens, input state, shared context and the console buffer.
- Game
Hooks - Where the game has a say in the frame loop.
Defaulthas none. - Glyph
Buffer - A grid of
Cells, row-major. - Install
- What
Module::installdeclares with. - Layer
- One layer of the bundle.
- Rect
- A rectangle of cells. A non-positive
worhmeans empty. - Rgb
- A 24-bit RGB colour. Ordered red, then green, then blue: an order for maps, not a look.
- Screen
Result - A value a screen pops with (
Transition::PopWith) for the screen below, which reads it back as its type inScreen::uncovered. Any'statictype will do; the two screens agree on which.
Enums§
- BoxStyle
- Border style for
GlyphBuffer::draw_box(game ADR-0012: single for panels, double for focus/modal). - Engine
Color - The colors the engine’s own widgets ask for. A game’s
ColorSetsays which of its palette’s names each one is (engine_name). - Hook
- A place in the frame loop where the game calls a module.
- Transition
- What a screen asks the stack to do after an update.
- UiAction
- What the generic widgets (a menu), the Key bindings screen and the debug
hook react to. A game maps some of its actions onto these with
ActionSet::ui; the rest are its own business.
Traits§
- Action
Set - Everything a player can ask for in one game: the game’s action enum. The keymap file, the keymap, held keys and repeat, the player’s saved bindings and help text are all built on it, never on one game’s actions.
- Game
Data - The game’s part of the
Ctx, and what the engine reads from the game’s data through it: its actions, colors, text, keys, audio manifest and palettes, and the hooks where the game has a say. - Module
- A piece that joins a running game: the game installs it with
Game::with_module, and calls only the hooks itsinstalldeclares, in install order. - Screen
- One screen of a game: a title, a map, a menu overlay, …
Functions§
- print_
centred - Prints
textcentred on rowy. A text wider thanbufstarts at column 0,cutto the buffer’s width.