worldstage

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: LGPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) CompareAndSwap

func (m *Manager) CompareAndSwap(oldStage, newStage Stage) (swapped bool)

func (*Manager) Current

func (m *Manager) Current() Stage

func (*Manager) NotifyOnStage

func (m *Manager) NotifyOnStage(stage Stage) <-chan struct{}

NotifyOnStage returns a channel that will be closed when the specified stage has been reached.

func (*Manager) Store

func (m *Manager) Store(newStage Stage)

type Stage

type Stage string
const (
	Init         Stage = "Init"         // The default stage of world
	Starting     Stage = "Starting"     // World is moved to this stage after StartGame() is called
	Recovering   Stage = "Recovering"   // World is moved to this stage when recoverFromChain() is called
	Ready        Stage = "Ready"        // World is moved to this stage when it's ready to start ticking
	Running      Stage = "Running"      // World is moved to this stage when Tick() is first called
	ShuttingDown Stage = "ShuttingDown" // World is moved to this stage when it received a shutdown signal
	ShutDown     Stage = "ShutDown"     // World is moved to this stage when it has successfully shutdown
)

Jump to

Keyboard shortcuts

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