func (e *Entity) ApplyUpdate(reader *bit.BitReader) {
	idx := -1
	newWay := reader.ReadBit()
	updatedPropIndices := updatedPropIndicesPool.Get().(*[]int)

	for idx = readFieldIndex(reader, idx, newWay); idx != -1; idx = readFieldIndex(reader, idx, newWay) {
		*updatedPropIndices = append(*updatedPropIndices, idx)
	}

	for _, idx := range *updatedPropIndices {
		propDecoder.decodeProp(&e.props[idx], reader)
	}

	// Fire update only after all properties have been updated
	// That way data that is made up of multiple properties won't be wrong
	// For instance the entity's position
	for _, idx := range *updatedPropIndices {
		e.props[idx].firePropertyUpdate()
	}

	// Reset length to 0 before pooling
	*updatedPropIndices = (*updatedPropIndices)[:0]
	// Defer has quite the overhead so we just fill the pool here
	updatedPropIndicesPool.Put(updatedPropIndices)
}
// ApplyUpdate reads an update to an Enitiy's properties and
// triggers registered PropertyUpdateHandlers if values changed.
//
// Intended for internal use only.
ApplyUpdate reads an update to an Enitiy's properties and
triggers registered PropertyUpdateHandlers if values changed.

Intended for internal use only.
// ApplyUpdate reads an update to an Enitiy ' s properties and // triggers registered PropertyUpdateHandlers if values changed . // // Intended for internal use only .
func (e *Entity) ApplyUpdate(reader *bit.BitReader) {
	idx := -1
	newWay := reader.ReadBit()
	updatedPropIndices := updatedPropIndicesPool.Get().(*[]int)
	for idx = readFieldIndex(reader, idx, newWay); idx != -1; idx = readFieldIndex(reader, idx, newWay) {
		*updatedPropIndices = append(*updatedPropIndices, idx)
	}
	for _, idx := range *updatedPropIndices {
		propDecoder.decodeProp(&e.props[idx], reader)
	}
	for _, idx := range *updatedPropIndices {
		e.props[idx].firePropertyUpdate()
	}
	*updatedPropIndices = (*updatedPropIndices)[:0]
	updatedPropIndicesPool.Put(updatedPropIndices)
}
func ( e * Entity ) ApplyUpdate ( reader * bit . BitReader ) { idx := - 1 newWay := reader . ReadBit ( ) updatedPropIndices := updatedPropIndicesPool . Get ( ) . ( * [ ] int ) for idx = readFieldIndex ( reader , idx , newWay ) ; idx != - 1 ; idx = readFieldIndex ( reader , idx , newWay ) { * updatedPropIndices = append ( * updatedPropIndices , idx ) } for _ , idx := range * updatedPropIndices { propDecoder . decodeProp ( & e . props [ idx ] , reader ) } for _ , idx := range * updatedPropIndices { e . props [ idx ] . firePropertyUpdate ( ) } * updatedPropIndices = ( * updatedPropIndices ) [ : 0 ] updatedPropIndicesPool . Put ( updatedPropIndices ) }
ApplyUpdate reads an update to an Enitiy's properties and
triggers registered PropertyUpdateHandlers if values changed.
ApplyUpdate reads an update to an Enitiy ' s properties and triggers registered PropertyUpdateHandlers if values changed .
// Fire update only after all properties have been updated // That way data that is made up of multiple properties won't be wrong // For instance the entity's position // Reset length to 0 before pooling // Defer has quite the overhead so we just fill the pool here