alarm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

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

func (*Alarm) Get

func (alarm *Alarm) Get() float64

func (*Alarm) IsRunning

func (alarm *Alarm) IsRunning() bool

IsRunning will return true if the timer is set and running. When used with Set, it will remain true until Tick() returns true When used with Repeat, it will always remain true after Repeat() is called for the first time.

func (Alarm) MarshalBinary

func (alarm Alarm) MarshalBinary() ([]byte, error)

func (*Alarm) Repeat

func (alarm *Alarm) Repeat(ticks float64) bool

Repeat is like to be used for events that repeat every N frames and will return true once N frames are processed

func (*Alarm) Set

func (alarm *Alarm) Set(ticks float64)

Set an alarm. This requires you process it every Update with Tick

func (*Alarm) Tick

func (alarm *Alarm) Tick() bool

Tick will process the timed event and return true if the timer has expired

func (*Alarm) UnmarshalBinary

func (alarm *Alarm) UnmarshalBinary(data []byte) error

func (Alarm) UnsafeSnapshotMarshalBinary

func (alarm Alarm) UnsafeSnapshotMarshalBinary(buf *bytes.Buffer) error

func (*Alarm) UnsafeSnapshotUnmarshalBinary

func (alarm *Alarm) UnsafeSnapshotUnmarshalBinary(buf *bytes.Buffer) error

Jump to

Keyboard shortcuts

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