data

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoPosition = NewPos(0, 0)

Functions

This section is empty.

Types

type Collider

type Collider interface {
	Collides(with Position) bool
}

type CommonLocation

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

func NewLocation

func NewLocation(whereabouts rpg.Location) CommonLocation

func (*CommonLocation) AddPassage

func (l *CommonLocation) AddPassage(in Position, out Position, to Location)

func (CommonLocation) LeftTop

func (l CommonLocation) LeftTop() Position

func (CommonLocation) Name

func (l CommonLocation) Name() string

func (CommonLocation) Npcs

func (l CommonLocation) Npcs() []Npc

func (CommonLocation) Objects

func (l CommonLocation) Objects() []Object

func (CommonLocation) Passages

func (l CommonLocation) Passages() []Passage

func (*CommonLocation) PlaceObject

func (l *CommonLocation) PlaceObject(object Object, at Position)

func (CommonLocation) RightBottom

func (l CommonLocation) RightBottom() Position

func (*CommonLocation) Spawn

func (l *CommonLocation) Spawn(npc Npc, position Position)

type Location

type Location interface {
	LeftTop() Position
	RightBottom() Position
	Name() string
	Spawn(npc Npc, position Position)
	Npcs() []Npc
	AddPassage(in Position, out Position, to Location)
	Passages() []Passage
	PlaceObject(object Object, at Position)
	Objects() []Object
}

type Npc

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

func NewNpc

func NewNpc(template rpg.NPC, icon rune, pos Position) Npc

func (Npc) Collides

func (n Npc) Collides(with Position) bool

func (Npc) Icon

func (n Npc) Icon() rune

func (Npc) Position

func (n Npc) Position() Position

func (Npc) Style

func (n Npc) Style() tcell.Style

type Object

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

func NewObject

func NewObject(name string, icon rune, solid bool) Object

func (Object) Collides

func (o Object) Collides(with Position) bool

func (Object) Icon

func (o Object) Icon() rune

func (Object) Position

func (o Object) Position() Position

func (Object) Solid

func (o Object) Solid() bool

func (Object) Style

func (o Object) Style() tcell.Style

type Passage

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

func (Passage) Icon

func (p Passage) Icon() rune

func (Passage) Position

func (p Passage) Position() Position

func (Passage) Style

func (p Passage) Style() tcell.Style

type Player

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

func NewPlayer

func NewPlayer(player *rpg.Player) *Player

func (Player) ActiveDialogue

func (p Player) ActiveDialogue() rpg.Dialogue

func (Player) ChooseDialogueReplyOption

func (p Player) ChooseDialogueReplyOption(choice int)

func (Player) Collides

func (p Player) Collides(with Position) bool

func (*Player) EndDialogue

func (p *Player) EndDialogue()

func (Player) Icon

func (p Player) Icon() rune

func (Player) Interact

func (p Player) Interact(element interactive.Element)

func (*Player) MoveTo

func (p *Player) MoveTo(to Position)

func (Player) Name

func (p Player) Name() string

func (Player) Position

func (p Player) Position() Position

func (*Player) StartDialogue

func (p *Player) StartDialogue(with Npc)

func (Player) Style

func (p Player) Style() tcell.Style

func (*Player) Teleport

func (p *Player) Teleport(to Position)

func (*Player) TeleportToLocation

func (p *Player) TeleportToLocation(location Location, to Position)

func (Player) Whereabouts

func (p Player) Whereabouts() Location

type Pos

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

func (Pos) X

func (p Pos) X() int

func (Pos) Y

func (p Pos) Y() int

type Position

type Position interface {
	X() int
	Y() int
}

func NewPos

func NewPos(x int, y int) Position

Jump to

Keyboard shortcuts

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