mines
Loading...
Searching...
No Matches
GameView Class Referenceexport
module mines

Text user interface view of a Game. More...

Public Member Functions

void run (Game &game, Interface &interface, Console &console)
 Give control to the view.

Static Public Member Functions

static GameView create ()
 Construct a view.

Detailed Description

Text user interface view of a Game.

Renders the game in a terminal using Unicode characters. The interface is controlled using a keyboard.

Controls

Game

  • h: Move cursor left.
  • j: Move cursor down.
  • k: Move cursor up.
  • l: Move cursor right.
  • Space: Uncover cell.
  • /: Flag/mark/reset cell. Skips marking if marks are disabled.
  • m: Open menu.
  • q: Quit the game.

Menu

  • j: Move selection down.
  • k: Move selection up.
  • Space: Confirm selected option.

Options

  • New game: Start a new game.
  • Edit game: Start a new game with changed parameters.
  • Leaderboard: View leaderboard.
  • Change player name: Change current player name.
  • Disable marks / Enable marks: Toggle marks.
  • Quit: Quit the game.
  • Back: Exit from the menu.

Member Function Documentation

◆ run()

void GameView::run ( Game & game,
Interface & interface,
Console & console )
inline

Give control to the view.

Renders the game and accepts user input. Gives control back once the user decides to quit.

Parameters
gameGame model to interact with.
interfaceUser interface model to use.
consoleConsole to use for input/output.

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