client

package
v0.0.0-...-a7e05d3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameClient

type GameClient struct {
	CurrentPlayer uuid.UUID
	Stream        proto.Game_StreamClient
	Game          *backend.Game
	View          *frontend.View
	// contains filtered or unexported fields
}

GameClient is used to stream game information to a server and update the game state as needed.

func NewGameClient

func NewGameClient(game *backend.Game, view *frontend.View) *GameClient

NewGameClient constructs a new game client struct.

func (*GameClient) Connect

func (c *GameClient) Connect(grpcClient proto.GameClient, playerID uuid.UUID, playerName string, password string) error

Connect connects a new player to the server.

func (*GameClient) Exit

func (c *GameClient) Exit(message string)

Exit stops the tview application and prints a message. This is needed as stdout is mangled while tview is running.

func (*GameClient) Start

func (c *GameClient) Start()

Start begins the goroutines needed to recieve server changes and send game changes.

Jump to

Keyboard shortcuts

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