metal

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: 8 Imported by: 0

Documentation

Overview

Package metal implements the meta interfaces for an in-memory game model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackList

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

func (CallbackList) CallbackNum

func (cl CallbackList) CallbackNum(i int) ident.Id

func (CallbackList) NumCallback

func (cl CallbackList) NumCallback() int

type DefaultActions

type DefaultActions map[ident.Id][]ident.Id

actionId -> callbackId

type EventCallbacks

type EventCallbacks map[ident.Id][]M.ListenerModel

indexed by eventId

type GenericValue

type GenericValue interface{}

type Metal

type Metal struct {
	*M.Model
	// contains filtered or unexported fields
}

func NewMetal

func NewMetal(m *M.Model, v ObjectValue) *Metal

func (*Metal) ActionNum

func (mdl *Metal) ActionNum(i int) meta.Action

func (*Metal) AreCompatible

func (mdl *Metal) AreCompatible(child, parent ident.Id) (okay bool)

func (*Metal) ClassNum

func (mdl *Metal) ClassNum(i int) meta.Class

func (*Metal) EventNum

func (mdl *Metal) EventNum(i int) meta.Event

func (*Metal) GetAction

func (mdl *Metal) GetAction(id ident.Id) (ret meta.Action, okay bool)

func (*Metal) GetClass

func (mdl *Metal) GetClass(id ident.Id) (ret meta.Class, okay bool)

func (*Metal) GetEvent

func (mdl *Metal) GetEvent(id ident.Id) (ret meta.Event, okay bool)

func (*Metal) GetInstance

func (mdl *Metal) GetInstance(id ident.Id) (ret meta.Instance, okay bool)

func (*Metal) GetRelation

func (mdl *Metal) GetRelation(id ident.Id) (ret meta.Relation, okay bool)

func (*Metal) InstanceNum

func (mdl *Metal) InstanceNum(i int) meta.Instance

func (*Metal) MatchNounName

func (mdl *Metal) MatchNounName(n string, f func(ident.Id) bool) (int, bool)

hrmmm...

func (*Metal) NumAction

func (mdl *Metal) NumAction() int

func (*Metal) NumClass

func (mdl *Metal) NumClass() int

func (*Metal) NumEvent

func (mdl *Metal) NumEvent() int

func (*Metal) NumInstance

func (mdl *Metal) NumInstance() int

func (*Metal) NumParserAction

func (mdl *Metal) NumParserAction() int

func (*Metal) NumRelation

func (mdl *Metal) NumRelation() int

func (*Metal) ParserActionNum

func (mdl *Metal) ParserActionNum(i int) meta.ParserAction

func (*Metal) Pluralize

func (mdl *Metal) Pluralize(single string) (plural string)

func (*Metal) RelationNum

func (mdl *Metal) RelationNum(i int) meta.Relation

type ObjectValue

type ObjectValue interface {
	GetValue(cls, field ident.Id) (interface{}, bool)
	SetValue(cls, field ident.Id, v interface{}) error
}

type ObjectValueMap

type ObjectValueMap map[string]interface{}

ObjectValueMap provides a default implementation of ObjectValue

func (ObjectValueMap) GetValue

func (m ObjectValueMap) GetValue(obj, field ident.Id) (interface{}, bool)

GetValue succeeds if SetValue was called on a corresponding obj.field.

func (ObjectValueMap) SetValue

func (m ObjectValueMap) SetValue(obj, field ident.Id, value interface{}) (err error)

SetValue always succeeds, storing the passed value to the map at obj.field.

type PropertyCache

type PropertyCache map[ident.Id]PropertyList

type PropertyEntry

type PropertyEntry struct {
	*M.PropertyModel
	// contains filtered or unexported fields
}

array of properties ( for flat cache ) ordered for linear traversal. children appear first; redudent properties are *not* removed.

type PropertyList

type PropertyList []*PropertyEntry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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