Redo and simplify registry and move to own package

This commit is contained in:
bloeys
2023-10-06 07:28:16 +04:00
parent 1b83d7f9a7
commit 039d09f888
8 changed files with 198 additions and 178 deletions

View File

@ -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 {