domain

package
v0.0.0-...-12cc501 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpeciesHuman   = "human"
	SpeciesElf     = "elf"
	SpeciesDwarf   = "dwarf"
	SpeciesHalfing = "halfing"
	SpeciesKender  = "kender"
	SpeciesGnome   = "gnome"
)

Variables

View Source
var (
	// ErrWorldDoesNotExist is returned when a world does not exist
	ErrWorldDoesNotExist = NewResourceDoesNotExistError("world does not exist")
)

Functions

This section is empty.

Types

type Character

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

func (*Character) ID

func (c *Character) ID() CharacterID

func (*Character) Name

func (c *Character) Name() string

func (*Character) Species

func (c *Character) Species() Species

type CharacterBuilder

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

func (*CharacterBuilder) Build

func (cb *CharacterBuilder) Build() (*Character, error)

func (*CharacterBuilder) WithID

func (*CharacterBuilder) WithName

func (cb *CharacterBuilder) WithName(name string) *CharacterBuilder

func (*CharacterBuilder) WithSpecies

func (cb *CharacterBuilder) WithSpecies(species Species) *CharacterBuilder

type CharacterID

type CharacterID string

type Error

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

func NewLogicError

func NewLogicError(message string) *Error

func NewResourceDoesNotExistError

func NewResourceDoesNotExistError(message string) *Error

func NewUnexpectedError

func NewUnexpectedError(message string) *Error

func NewValidationError

func NewValidationError(message string) *Error

func (*Error) Error

func (e *Error) Error() string

type ErrorType

type ErrorType int
const (
	UnexpectedError ErrorType = iota
	ValidationError
	LogicError
	ResourceDoesNotExistError
)

type NameGenerator

type NameGenerator interface {
	GenerateCharacterName(species Species) string
}

type Party

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

func NewParty

func NewParty(characters []Character) (*Party, error)

func (*Party) Characters

func (p *Party) Characters() []Character

func (*Party) Size

func (p *Party) Size() int

type Species

type Species string

type Story

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

func (*Story) Characters

func (s *Story) Characters() []Character

func (*Story) ID

func (s *Story) ID() StoryID

func (*Story) PartySize

func (s *Story) PartySize() int

func (*Story) WorldID

func (s *Story) WorldID() WorldID

type StoryBuilder

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

func (*StoryBuilder) Build

func (sb *StoryBuilder) Build() (*Story, error)

func (*StoryBuilder) WithID

func (sb *StoryBuilder) WithID(id StoryID) *StoryBuilder

func (*StoryBuilder) WithParty

func (sb *StoryBuilder) WithParty(party *Party) *StoryBuilder

func (*StoryBuilder) WithWorld

func (sb *StoryBuilder) WithWorld(world *World) *StoryBuilder

type StoryFactory

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

func (*StoryFactory) Build

func (sb *StoryFactory) Build() (*Story, error)

func (*StoryFactory) WithNameGenerator

func (sb *StoryFactory) WithNameGenerator(nameGenerator NameGenerator) *StoryFactory

func (*StoryFactory) WithPartySize

func (sb *StoryFactory) WithPartySize(partySize *uint8) *StoryFactory

func (*StoryFactory) WithWorld

func (sb *StoryFactory) WithWorld(world *World) *StoryFactory

type StoryID

type StoryID string

type World

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

World represents a world in the game

func (World) ID

func (w World) ID() WorldID

func (World) Name

func (w World) Name() string

func (World) Species

func (w World) Species() []Species

type WorldBuilder

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

func (*WorldBuilder) Build

func (wb *WorldBuilder) Build() *World

func (*WorldBuilder) WithID

func (wb *WorldBuilder) WithID(id WorldID) *WorldBuilder

func (*WorldBuilder) WithName

func (wb *WorldBuilder) WithName(name string) *WorldBuilder

func (*WorldBuilder) WithSpecies

func (wb *WorldBuilder) WithSpecies(species []Species) *WorldBuilder

type WorldID

type WorldID string

WorldID represents the ID of a world

Jump to

Keyboard shortcuts

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