jui

package
v0.0.0-...-591fb6e Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	GetGrid() *ui.Grid
	HandleUIEvent(ui.Event) bool
	HandleServerEvent(*cpb.BroadcastMsg) bool
	// lifecycle
	WillMount(interface{})
	DidMount()
	WillUnmount()
	DidUnmount()
	Reset() error
	// the standard timetick is called every 0.05 sec
	TimeTick()
}

type DefaultRouter

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

func NewDefaultRouter

func NewDefaultRouter() *DefaultRouter

func (*DefaultRouter) GetCurrentComponent

func (dr *DefaultRouter) GetCurrentComponent() Component

func (*DefaultRouter) GetCurrentPath

func (dr *DefaultRouter) GetCurrentPath() string

func (*DefaultRouter) Navigate

func (dr *DefaultRouter) Navigate(path string, args interface{}) error

func (*DefaultRouter) NavigateBack

func (dr *DefaultRouter) NavigateBack() error

func (*DefaultRouter) RegisterComponent

func (dr *DefaultRouter) RegisterComponent(path string, component Component) error

func (*DefaultRouter) UnRegisterComponent

func (dr *DefaultRouter) UnRegisterComponent(path string)

type DefaultStore

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

func NewDefaultStore

func NewDefaultStore() *DefaultStore

func (*DefaultStore) Get

func (ds *DefaultStore) Get(key string) (interface{}, bool)

func (*DefaultStore) GetGameCoreClient

func (ds *DefaultStore) GetGameCoreClient() cpb.GameCoreClient

func (*DefaultStore) GetRouter

func (ds *DefaultStore) GetRouter() Router

func (*DefaultStore) GetToken

func (ds *DefaultStore) GetToken() string

func (*DefaultStore) Set

func (ds *DefaultStore) Set(key string, value interface{})

func (*DefaultStore) SetGameCoreClient

func (ds *DefaultStore) SetGameCoreClient(gcc cpb.GameCoreClient)

func (*DefaultStore) SetRouter

func (ds *DefaultStore) SetRouter(r Router)

func (*DefaultStore) SetToken

func (ds *DefaultStore) SetToken(t string)

type Router

type Router interface {
	Navigate(path string, args interface{}) error
	NavigateBack() error
	GetCurrentPath() string
	GetCurrentComponent() Component
	RegisterComponent(path string, component Component) error
	UnRegisterComponent(path string)
}

type Store

type Store interface {
	SetRouter(Router)
	SetGameCoreClient(cpb.GameCoreClient)
	GetRouter() Router
	GetGameCoreClient() cpb.GameCoreClient
	SetToken(string)
	GetToken() string

	Set(key string, value interface{})
	Get(key string) (interface{}, bool)
}

Jump to

Keyboard shortcuts

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