Struct n18ui::UserInterface[][src]

pub struct UserInterface {
    pub assets: Assets,
    pub state: State,
    pub controller: Controller,
    pub keymap: Keymap,
    pub canvas: Canvas,
    // some fields omitted
}
Expand description

Defines the user interface.

Fields

assets: Assetsstate: Statecontroller: Controllerkeymap: Keymapcanvas: Canvas

Implementations

Creates the initial user interface state.

Draws the current state of the user interface.

Returns the minimum allowed hex diameter, which limits zooming out.

Returns the maximum allowed hex diameter, which limits zooming in.

Returns the dimensions of the current game map, in pixels.

Requests the drawing area to update its size, and redraws the current game state.

This should be called when the user has zoomed in or zoomed out.

Resets the drawing surface, requests the drawing area to update its size, and redraws the current game state.

This should only be called when the active game has changed (e.g., when creating a new game or loading a saved game).

Sets the window title to the game name, replacing any state-specific title.

Responds to an event triggered by something other than a UI event (e.g., a message from a task running in a separate thread).

Creates a new game, identified by index into the game library.

Loads a saved game state from path.

Saves the current game state to path.

Saves an image to path.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.