Skip to content

Commit

Permalink
Remove autoregister (not needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
imthatgin committed Apr 1, 2024
1 parent 09c58f6 commit c01d7a4
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions esync/esync_shared.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package esync

import (
"github.com/leap-fish/necs/typeid"
"github.com/leap-fish/necs/typemapper"
"github.com/yohamta/donburi"
"github.com/yohamta/donburi/filter"
Expand Down Expand Up @@ -46,20 +45,6 @@ func RegisterComponent(id uint, component any, ctype donburi.IComponentType) err
return nil
}

// AutoRegister registers a component by using typeID instead of manually defined IDs.
// This is experimental, and can produce duplicates for some types.
func AutoRegister(component any, ctype donburi.IComponentType) error {
typ := reflect.TypeOf(component)
id := typeid.GetTypeId(typ)
err := Mapper.RegisterType(id, typ)
if err != nil {
return err
}
registered[typ] = ctype

return nil
}

// FindByNetworkId performs an "Each" query over network entities to find one with a matching ID.
func FindByNetworkId(world donburi.World, networkId NetworkId) donburi.Entity {
var found donburi.Entity
Expand Down

0 comments on commit c01d7a4

Please sign in to comment.