brownboxbatman/component/creepbullet.go

24 lines
483 B
Go
Raw Normal View History

2021-12-26 23:13:32 +00:00
package component
import (
. "code.rocketnine.space/tslocum/brownboxbatman/ecs"
"code.rocketnine.space/tslocum/gohan"
)
type CreepBulletComponent struct {
}
var CreepBulletComponentID = ECS.NewComponentID()
func (p *CreepBulletComponent) ComponentID() gohan.ComponentID {
return CreepBulletComponentID
}
func CreepBullet(ctx *gohan.Context) *CreepBulletComponent {
c, ok := ctx.Component(CreepBulletComponentID).(*CreepBulletComponent)
if !ok {
return nil
}
return c
}