Documentation
¶
Index ¶
- Variables
- func ComponentFromVal(ctype donburi.IComponentType, value interface{}) unsafe.Pointer
- func FindByNetworkId(world donburi.World, networkId NetworkId) donburi.Entity
- func RegisterComponent(id uint, component any, ctype donburi.IComponentType) error
- func Registered(componentType reflect.Type) (donburi.IComponentType, bool)
- type ComponentId
- type EntityState
- type NetworkId
- type SerializedEntity
- type WorldSnapshot
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Mapper = typemapper.NewMapper(map[uint]any{}) NetworkIdComponent = donburi.NewComponentType[NetworkId]() )
View Source
var NetworkEntityQuery = donburi.NewQuery(filter.Contains(NetworkIdComponent))
Functions ¶
func ComponentFromVal ¶
func ComponentFromVal(ctype donburi.IComponentType, value interface{}) unsafe.Pointer
func FindByNetworkId ¶
FindByNetworkId performs an "Each" query over network entities to find one with a matching ID.
func RegisterComponent ¶
func RegisterComponent(id uint, component any, ctype donburi.IComponentType) error
RegisterComponent registers a component for use with esync. Make sure the client and server have the same definition of components. Note that ID 1 is reserved for the NetworkId component used by esync.
func Registered ¶
func Registered(componentType reflect.Type) (donburi.IComponentType, bool)
Types ¶
type ComponentId ¶
type ComponentId uint
type EntityState ¶
type EntityState map[ComponentId][]byte
type SerializedEntity ¶
type SerializedEntity struct { Id NetworkId State EntityState }
type WorldSnapshot ¶
type WorldSnapshot []SerializedEntity
Click to show internal directories.
Click to hide internal directories.