menu

package
v0.0.0-...-ed902dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

menu create main menu of the game

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallClear

func CallClear()

CallClear clear terminal

func PrintManual

func PrintManual(scanner *bufio.Scanner) error

PrintManual print game manual

func ShowLeaderBoard

func ShowLeaderBoard(ctx context.Context, client connection.Client, scanner *bufio.Scanner, startingHeader connection.StartingHeader) error

ShowLeaderboard displays the leaderboard with player statistics

Types

type UserIntent

type UserIntent uint8

UserIntent represents the user's intention from the main menu

const (
	// WaitForChallenge indicates the user wants to wait for a challenge
	WaitForChallenge UserIntent = iota
	// ExitTheGame indicates the user wants to exit the game
	ExitTheGame
	// StartGame indicates the user wants to start a game
	StartGame
)
func MainMenu(ctx context.Context, client connection.Client) UserIntent

MainMenu displays the main menu and handles user input

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL