config

package
v0.1.6-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The number of tetriminos to display in the Next Queue.
	NextQueueLength int `toml:"next_queue_length"`

	// Whether a ghost piece will be displayed beneath the current tetrimino.
	GhostEnabled bool `toml:"ghost_enabled"`

	// TODO: What mode to use when locking down a tetrimino.
	LockDownMode string `toml:"lock_down_mode"`

	// The maximum level to reach before the game ends or the level stops increasing.
	MaxLevel int `toml:"max_level"`

	// Whether the game ends when the max level is reached.
	EndOnMaxLevel bool `toml:"end_on_max_level"`

	// The styling for the game in all modes
	Theme *Theme `toml:"theme"`

	// The keybindings for the game
	Keys *Keys `toml:"keys"`
}

func GetConfig

func GetConfig(path string) (*Config, error)

type Keys

type Keys struct {
	ForceQuit              []string `toml:"force_quit"`
	Exit                   []string `toml:"exit"`
	Help                   []string `toml:"help"`
	Submit                 []string `toml:"submit"`
	Up                     []string `toml:"up"`
	Down                   []string `toml:"down"`
	Left                   []string `toml:"left"`
	Right                  []string `toml:"right"`
	RotateCounterClockwise []string `toml:"rotate_counter_clockwise"`
	RotateClockwise        []string `toml:"rotate_clockwise"`
}

type Theme

type Theme struct {
	Colours struct {
		TetriminoCells struct {
			I string `toml:"I"`
			O string `toml:"O"`
			T string `toml:"T"`
			S string `toml:"S"`
			Z string `toml:"Z"`
			J string `toml:"J"`
			L string `toml:"L"`
		} `toml:"tetrimino_cells"`
		EmptyCell string `toml:"empty_cell"`
		GhostCell string `toml:"ghost_cell"`
	} `toml:"colours"`
	Characters struct {
		Tetriminos string `toml:"tetriminos"`
		EmptyCell  string `toml:"empty_cell"`
		GhostCell  string `toml:"ghost_cell"`
	} `toml:"characters"`
}

Jump to

Keyboard shortcuts

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