package funcLoad import cfacade "github.com/cherry-game/cherry/facade" type ( component struct { cfacade.Component name string fn ExecuteFn } ExecuteFn func(app cfacade.IApplication) ) func New(name string, fn ExecuteFn) *component { return &component{ name: name, fn: fn, } } func (c *component) Name() string { return c.name } func (c *component) Init() { if c.fn != nil { c.fn(c.App()) } }