timer

package
v0.0.0-...-e2c201e Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventMessageWidget

func NewEventMessageWidget(root *sws.RootWidget, longdesc string) *sws.MainWidget

Types

type EventMessageWidget

type EventMessageWidget struct {
	sws.CoreWidget
}

type EventPublished

type EventPublished struct {
	sws.CoreWidget
	// contains filtered or unexported fields
}

func NewEventPublished

func NewEventPublished(shortdesc string, longdesc string, eventpub *EventPublisher, pos int32) *EventPublished

type EventPublisher

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

func NewEventPublisher

func NewEventPublisher(root *sws.RootWidget) *EventPublisher

func (*EventPublisher) Publish

func (self *EventPublisher) Publish(shortdesc string, longdesc string)

type EventPublisherService

type EventPublisherService interface {
	Publish(shortdesc string, longdesc string)
}

type GameCronEvent

type GameCronEvent struct {
	Trigger func()
	// contains filtered or unexported fields
}

type GameTimer

type GameTimer struct {
	CurrentTime time.Time // current day
	TimerClock  func()    // method to call when we switch to a new day
	// contains filtered or unexported fields
}

func NewGameTimer

func NewGameTimer() *GameTimer

NewGameTimer create a timer object starting at 1/1/1990

func (*GameTimer) AddCron

func (self *GameTimer) AddCron(day, month, year int32, callback func()) *GameCronEvent

func (*GameTimer) AddEvent

func (self *GameTimer) AddEvent(evdate time.Time, callback func())

func (*GameTimer) Load

func (self *GameTimer) Load(game map[string]interface{})

func (*GameTimer) RemoveCron

func (self *GameTimer) RemoveCron(evt *GameCronEvent)

func (*GameTimer) Save

func (self *GameTimer) Save() string

type GamerTimerEvent

type GamerTimerEvent struct {
	Id      int32
	Date    time.Time
	Trigger func()
}

func (*GamerTimerEvent) Less

func (self *GamerTimerEvent) Less(b btree.Item) bool

Jump to

Keyboard shortcuts

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