scoreboard

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 2 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scoreboard

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

Scoreboard represents a scoreboard that may be sent to a player. The scoreboard is shown on the right side of the player's screen. Scoreboard implements the io.Writer and io.StringWriter interfaces. fmt.Fprintf and fmt.Fprint may be used to write formatted text to the scoreboard.

func New

func New(name ...interface{}) *Scoreboard

New returns a new scoreboard with the display name passed. Once returned, lines may be added to the scoreboard to add text to it. The name is formatted according to the rules of fmt.Sprintln. Changing the scoreboard after sending it to a player will not update the scoreboard of the player automatically: Player.SendScoreboard() must be called again to update it.

func (*Scoreboard) Lines added in v0.4.0

func (board *Scoreboard) Lines() []string

Lines returns the data of the Scoreboard as a slice of strings.

func (*Scoreboard) Name

func (board *Scoreboard) Name() string

Name returns the display name of the scoreboard, as passed during the construction of the scoreboard.

func (*Scoreboard) Remove added in v0.4.0

func (board *Scoreboard) Remove(index int) (err error)

Remove removes a specific line from the scoreboard.

func (*Scoreboard) Set added in v0.4.0

func (board *Scoreboard) Set(index int, s string) (err error)

Set changes a specific line in the scoreboard.

func (*Scoreboard) Write

func (board *Scoreboard) Write(p []byte) (n int, err error)

Write writes a slice of data as text to the scoreboard. Newlines may be written to create a new line on the scoreboard.

func (*Scoreboard) WriteString

func (board *Scoreboard) WriteString(s string) (n int, err error)

WriteString writes a string of text to the scoreboard. Newlines may be written to create a new line on the scoreboard.

Jump to

Keyboard shortcuts

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