scoreboard

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 3 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) Bytes

func (board *Scoreboard) Bytes() []byte

Bytes returns the data of the Scoreboard as a slice of bytes.

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) 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