Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TickList = &Scripts{}
TickList A collection of Tasks that are intended to be ran once per game engine tick. Tasks should contractually return either true if they are to be removed after execution completes, or false if they are to be ran again on the next engine cycle.
View Source
var (
Ticks = atomic.NewUint64(0)
)
Functions ¶
func CurrentTick ¶
func CurrentTick() tickCount
func DoOnce ¶
func DoOnce(ticks int, fn ScriptCall)
func DoOnceSync ¶
func DoOnceSync(ticks int, fn ScriptCall)
DoOnceSync Run a task one time, and then remove it, regardless of the return value of the call.
func Schedule ¶
func Schedule(ticks int, call StatusReturnCall)
Types ¶
type ScriptCall ¶
type ScriptCall interface{}
scriptCall This is a type-free box type, made for boxing function pointers usually from an Anko script.
type Scripts ¶
type Scripts struct { ScriptCalls sync.RWMutex }
Scripts A locked slice of ScriptCalls.
func (*Scripts) Schedule ¶
func (s *Scripts) Schedule(ticks int, fn ScriptCall)
type StatusReturnCall ¶
type StatusReturnCall = func() bool
Call function type aliases for tickables etc
Click to show internal directories.
Click to hide internal directories.