mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
Redo and simplify registry and move to own package
This commit is contained in:
@ -1,19 +1,18 @@
|
||||
package entity
|
||||
|
||||
import "github.com/bloeys/nmage/assert"
|
||||
import "github.com/bloeys/nmage/registry"
|
||||
|
||||
var _ Comp = &BaseComp{}
|
||||
|
||||
type BaseComp struct {
|
||||
Entity *BaseEntity
|
||||
Handle registry.Handle
|
||||
}
|
||||
|
||||
func (b BaseComp) baseComp() {
|
||||
}
|
||||
|
||||
func (b *BaseComp) Init(parent *BaseEntity) {
|
||||
assert.T(parent != nil, "Component was initialized with a nil parent. That is not allowed.")
|
||||
b.Entity = parent
|
||||
func (b *BaseComp) Init(parentHandle registry.Handle) {
|
||||
b.Handle = parentHandle
|
||||
}
|
||||
|
||||
func (b BaseComp) Name() string {
|
||||
|
||||
Reference in New Issue
Block a user