Documentation ¶
Overview ¶
package model is a Go interface for the mobile devices on the Model level.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
func Main(appContext AppContext)
run game thread. the game thread runs on background so it returns imediately. quiting the game thread is notifyed through AppContext.NotifyQuit().
func SendCommand ¶
func SendCommand(cmd string)
func SendSkippingWait ¶
func SendSkippingWait()
func SendStopSkippingWait ¶
func SendStopSkippingWait()
func StringWidth ¶
Types ¶
type AppContext ¶
type AppContext interface { // it is called when mobile.app is quited. // the native framework must be quited by this signal. // the argument erorr indicates why app is quited. // nil error means quit correctly. NotifyQuit(error) }
AppContext manages application context.
type Printer ¶
type Printer interface { Print(s string) error PrintLabel(s string) error PrintButton(caption, command string) error PrintLine(sym string) error SetColor(c int32) error GetColor() (int32, error) ResetColor() error SetAlignmentLeft() error SetAlignmentCenter() error SetAlignmentRight() error NewPage() error ClearLine(nline int32) error ClearLineAll() error WindowLineWidth() (int32, error) WindowLineCount() (int32, error) CurrentLineWidth() (int32, error) LineCount() (int32, error) }
Printer is interface for the printing content to the view. Any functions of this are called asynchronously.
type UI ¶
type UI interface { Printer // it is called when mobile.app requires synchronized output // state to UI view. Sync() error // it is called when mobile.app requires inputting // user's command. OnCommandRequested() // it is called when mobile.app requires just input any command. OnInputRequested() // it is called when mobile.app no longer requires any input, // such as just-input and command. OnInputRequestClosed() }
erago.UI for java bind.
Click to show internal directories.
Click to hide internal directories.