jsmem

package
v0.0.0-...-9034458 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package jsmem bridges a json (net/app) game to gopherjs TBD: would []byte instead of string be faster ( re: utf8 )

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Create

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

func NewCreator

func NewCreator(mc ingest.ModelCode) *Create

func (*Create) NewGame

func (c *Create) NewGame() JsMem

New creates a blank js session.

func (*Create) RecordInput

func (c *Create) RecordInput() *Create

func (*Create) RestoreGame

func (c *Create) RestoreGame(data Storage) (ret JsMem, err error)

Restore uses the passed code and data as a starting point, and restores the saved json over top of it.

func (*Create) Save

func (c *Create) Save(save SaveCallback) *Create

type JsMem

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

func (*JsMem) Get

func (js *JsMem) Get(_, path string) (ret string, err error)

Get mirrors http get: retrieving data from the game

func (*JsMem) Post

func (js *JsMem) Post(_, body string) (ret string, err error)

Post mirrors http post: sending commands for the turn

type SaveCallback

type SaveCallback func(Storage, []string, bool) (slot string, err error)

type Storage

type Storage pack.ObjectValuePack

Jump to

Keyboard shortcuts

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