Compentize Workload (#4)

This commit is contained in:
2023-03-30 23:51:05 -04:00
committed by GitHub
parent 228c293b70
commit 3d15d09dd7
21 changed files with 528 additions and 319 deletions

22
common/component.go Normal file
View File

@@ -0,0 +1,22 @@
package common
type Component interface {
Initialize(birdbot ComponentManager) error
}
type ComponentManager interface {
OnReady(func() error) error
OnNotify(func(string) error) error
// Event events
OnEventCreate(func(Event) error) error
OnEventDelete(func(Event) error) error
OnEventUpdate(func(Event) error) error
OnEventComplete(func(Event) error) error
RegisterGameModule(ID string, plugin GameModule) error
CreateEvent(event Event) error
Notify(message string) error
}