registry

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedGameType = errors.New("unsupported game type")
)

Functions

This section is empty.

Types

type GameTypeRegistry

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

func NewGameTypeRegistry

func NewGameTypeRegistry() *GameTypeRegistry

func (*GameTypeRegistry) CreatePlayer

func (r *GameTypeRegistry) CreatePlayer(game types.GameMetadata, dir string) (scheduler.GamePlayer, error)

CreatePlayer creates a new game player for the given game, using the specified directory for persisting data.

func (*GameTypeRegistry) RegisterGameType

func (r *GameTypeRegistry) RegisterGameType(gameType uint8, creator scheduler.PlayerCreator)

RegisterGameType registers a scheduler.PlayerCreator to use for a specific game type. Panics if the same game type is registered multiple times, since this indicates a significant programmer error.

Jump to

Keyboard shortcuts

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