session

package
v0.0.0-...-3760201 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	C ssh.Channel

	LastAction time.Time
	HighScore  int
	Player     *player.Player
}

Session holds all data for a connected player

func NewSession

func NewSession(c ssh.Channel, worldWidth, worldHeight int,
	color color.Attribute) *Session

NewSession creates a new Session

func (*Session) HandleDown

func (s *Session) HandleDown()

HandleDown responds to the player pressing the down direction key

func (*Session) HandleLeft

func (s *Session) HandleLeft()

HandleLeft responds to the player pressing the left direction key

func (*Session) HandleRight

func (s *Session) HandleRight()

HandleRight responds to the player pressing the right direction key

func (*Session) HandleSlowDown

func (s *Session) HandleSlowDown()

HandleSlowDown responds to the player pressing the SlowDown key

func (*Session) HandleSpeedUp

func (s *Session) HandleSpeedUp()

HandleSpeedUp responds to the player pressing the SpeedUp key

func (*Session) HandleUp

func (s *Session) HandleUp()

HandleUp responds to the player pressing the up direction key

func (*Session) Read

func (s *Session) Read(p []byte) (int, error)

Read input over the connection channel

func (*Session) StartOver

func (s *Session) StartOver(worldWidth int, worldHeight int)

StartOver resets the current player in the game

func (*Session) Write

func (s *Session) Write(p []byte) (int, error)

Write output over the connection channel

Jump to

Keyboard shortcuts

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