Documentation ¶
Index ¶
- Constants
- type Difficulty
- type Game
- func (g *Game) AddPlayer(p *Player)
- func (g *Game) AmountOfConnectedPlayers() int
- func (g *Game) Disconnect(p *Player)
- func (g *Game) DisconnectWithReason(p *Player, reason chat.Chat)
- func (g *Game) Ready() <-chan struct{}
- func (g *Game) Start(ctx context.Context)
- func (g *Game) WritePacket(p *Player, pkg packet.Clientbound)
- type Gamemode
- type Option
- type Player
- type Sentinel
Constants ¶
View Source
const (
TickDuration = 50 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Difficulty ¶
type Difficulty int
const ( DifficultyPeaceful Difficulty = iota DifficultyEasy DifficultyNormal DifficultyHard )
func (Difficulty) String ¶
func (i Difficulty) String() string
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (*Game) AmountOfConnectedPlayers ¶
func (*Game) Disconnect ¶
func (*Game) DisconnectWithReason ¶
func (*Game) Start ¶
Start will start the game by starting to process incoming messages. This will also start the tick loop. This method will not terminate until the given context is canceled.
func (*Game) WritePacket ¶
func (g *Game) WritePacket(p *Player, pkg packet.Clientbound)
type Player ¶
func (*Player) Disconnect ¶
func (p *Player) Disconnect()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.