esync

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Mapper             = typemapper.NewMapper(map[uint]any{})
	NetworkIdComponent = donburi.NewComponentType[NetworkId]()
)

Functions

func ComponentFromVal

func ComponentFromVal(ctype donburi.IComponentType, value interface{}) unsafe.Pointer

func FindByNetworkId

func FindByNetworkId(world donburi.World, networkId NetworkId) donburi.Entity

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 NetworkId

type NetworkId uint

func GetNetworkId

func GetNetworkId(entry *donburi.Entry) *NetworkId

type SerializedEntity

type SerializedEntity struct {
	Id    NetworkId
	State EntityState
}

type WorldSnapshot

type WorldSnapshot []SerializedEntity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL