statemachine

package
v0.0.0-...-a793aa1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State uint8
const (
	WELCOME_SCREEN State = iota
	OPTIONS_MENU
	GAME
	PAUSE
	GAME_OVER
	EXIT
)

func (*State) EnumIndex

func (s *State) EnumIndex() uint8

func (*State) String

func (s *State) String() string

type StateMachine

type StateMachine struct {
	States       []State
	CurrentState State
	Transitions  map[State][]State
}

func NewStateMachine

func NewStateMachine() *StateMachine

func (*StateMachine) DoTransition

func (sm *StateMachine) DoTransition(from, to State) bool

Jump to

Keyboard shortcuts

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