rpg

package
v0.0.0-...-d03cab4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoDialogue = NewDialogue("", nil)
View Source
var NoNpc = NewNPC("", nil)

Functions

This section is empty.

Types

type Dialogue

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

func NewDialogue

func NewDialogue(text Phrase, choices []Phrase) Dialogue

func (Dialogue) Choices

func (d Dialogue) Choices() []Phrase

func (Dialogue) Empty

func (d Dialogue) Empty() bool

func (Dialogue) Text

func (d Dialogue) Text() Phrase

func (*Dialogue) With

func (d *Dialogue) With() NPC

type Location

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

func NewLocation

func NewLocation(id int, locationName string) Location

func (Location) Name

func (l Location) Name() string

type NPC

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

func NewNPC

func NewNPC(name string, dialogues map[Phrase]Dialogue) NPC

func (NPC) Name

func (n NPC) Name() string

func (NPC) Reply

func (n NPC) Reply(on Phrase) Dialogue

func (NPC) StartConversation

func (n NPC) StartConversation(p Player) Dialogue

type Phrase

type Phrase string

type Player

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

func NewPlayer

func NewPlayer(playerName string) Player

func (Player) ActiveDialogue

func (p Player) ActiveDialogue() Dialogue

func (*Player) EndConversation

func (p *Player) EndConversation()

func (*Player) MoveToLocation

func (p *Player) MoveToLocation(location Location)

func (Player) Name

func (p Player) Name() string

func (*Player) Reply

func (p *Player) Reply(to NPC, with Phrase) Dialogue

func (*Player) StartConversation

func (p *Player) StartConversation(npc NPC) Dialogue

func (Player) Whereabouts

func (p Player) Whereabouts() Location

Jump to

Keyboard shortcuts

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