asciigame

package
v0.10.48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ColorBlue = "\033[34m"
View Source
const ColorCyan = "\033[36m"
View Source
const ColorGreen = "\033[32m"
View Source
const ColorPurple = "\033[35m"
View Source
const ColorRed = "\033[31m"
View Source
const ColorReset = "\033[0m"
View Source
const ColorWhite = "\033[37m"
View Source
const ColorYellow = "\033[33m"

Variables

This section is empty.

Functions

func FormatColorString

func FormatColorString(str string, color Color) string

func OutputResults

func OutputResults(str string, result *sgc7game.PlayResult, isResult FuncIsResult, mapSymbolColor *SymbolColorMap)

func OutputScene

func OutputScene(str string, scene *sgc7game.GameScene, mapSymbolColor *SymbolColorMap)

func StartGame

func StartGame(game sgc7game.IGame, stake *sgc7game.Stake, onResult FuncOnResult) error

Types

type Color added in v0.10.47

type Color int
const (
	Red    Color = 1
	Green  Color = 2
	Yellow Color = 3
	Blue   Color = 4
	Purple Color = 5
	Cyan   Color = 6
	White  Color = 7
)

type FuncIsResult

type FuncIsResult func(*sgc7game.Result) bool

type FuncOnGetChar

type FuncOnGetChar func(k getch.KeyCode) bool

if return true, then break

type FuncOnResult

type FuncOnResult func(*sgc7game.PlayResult)

type SymbolColorMap

type SymbolColorMap struct {
	MapSymbols map[int]Color
	PayTables  *sgc7game.PayTables
}

func NewSymbolColorMap

func NewSymbolColorMap(paytables *sgc7game.PayTables) *SymbolColorMap

func (*SymbolColorMap) AddSymbolColor

func (mapSymbolColor *SymbolColorMap) AddSymbolColor(s int, c Color)

func (*SymbolColorMap) GetSymbolString

func (mapSymbolColor *SymbolColorMap) GetSymbolString(s int) string

Jump to

Keyboard shortcuts

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