views

package
v0.0.0-...-ef687d8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResultStates = map[string]string{
	"win": "You Won!", "lose": "You Lost!",
}

TODO: Make this translatable

Functions

This section is empty.

Types

type BoardConfig

type BoardConfig struct {
	Rows    int
	Columns int

	MaxSteps int
}

type CustomModePage

type CustomModePage struct {
	*adw.NavigationPage
	// contains filtered or unexported fields
}

func NewCustomModePage

func NewCustomModePage(parent *StartingView, settings *gio.Settings, toastOverlay *adw.ToastOverlay) *CustomModePage

type DifficultyPage

type DifficultyPage struct {
	*adw.NavigationPage
	// contains filtered or unexported fields
}

func NewDifficultyPage

func NewDifficultyPage(parent *StartingView, settings *gio.Settings, toastOverlay *adw.ToastOverlay) *DifficultyPage

type GamePage

type GamePage struct {
	*adw.Bin
	// contains filtered or unexported fields
}

func NewGamePage

func NewGamePage(parent *MainWindow, settings *gio.Settings, toastOverlay *adw.ToastOverlay) *GamePage

func (*GamePage) NewBoard

func (gp *GamePage) NewBoard(name string, rows int, cols int, maxSteps uint)

NewBoard initializes board, sets value for max amount of moves and queues a board draw NOTE: To get calculated amount of steps, you need to set maxSteps parameter to 0.

type GameRulesPage

type GameRulesPage struct {
	*adw.Bin
	// contains filtered or unexported fields
}

func NewGameRulesPage

func NewGameRulesPage(parent *MainWindow, settings *gio.Settings, toastOverlay *adw.ToastOverlay) *GameRulesPage

type MainWindow

type MainWindow struct {
	*adw.ApplicationWindow
	// contains filtered or unexported fields
}

func NewMainWindow

func NewMainWindow(app *adw.Application, settings *gio.Settings) *MainWindow

func (*MainWindow) StartNewGame

func (w *MainWindow) StartNewGame(name string, rows int, cols int, maxSteps uint)

StartNewGame calls NewBoard to initialize board, and changes view in main stack to show game page. NOTE: To get calculated amount of steps, you need to set maxSteps parameter to 0.

type ResultPage

type ResultPage struct {
	*adw.Bin
	// contains filtered or unexported fields
}

func NewResultPage

func NewResultPage(parent *MainWindow, settings *gio.Settings, toastOverlay *adw.ToastOverlay) *ResultPage

func (*ResultPage) SetResultState

func (r *ResultPage) SetResultState(isWin bool)

type StartingView

type StartingView struct {
	*adw.NavigationView
	// contains filtered or unexported fields
}

func NewStartingView

func NewStartingView(parent *MainWindow, settings *gio.Settings, toastOverlay *adw.ToastOverlay) *StartingView

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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