mirror of
https://port.numenaute.org/aleajactaest/bazar_alea.git
synced 2024-11-22 15:16:13 +00:00
36 lines
736 B
GDScript3
36 lines
736 B
GDScript3
|
class_name PackedFlowPush
|
||
|
|
||
|
var data:PackedByteArray = PackedByteArray()
|
||
|
|
||
|
|
||
|
func _init() -> void:
|
||
|
self.data.clear()
|
||
|
|
||
|
|
||
|
func put_u8(value:int) -> void:
|
||
|
data.append(value)
|
||
|
|
||
|
|
||
|
func put_u64(value:int) -> void:
|
||
|
var pos:PackedInt64Array = PackedInt64Array()
|
||
|
pos.append(value)
|
||
|
data += pos.to_byte_array()
|
||
|
|
||
|
|
||
|
func puf_f64(value:float) -> void:
|
||
|
var pos:PackedFloat64Array = PackedFloat64Array()
|
||
|
pos.append(value)
|
||
|
data += pos.to_byte_array()
|
||
|
|
||
|
|
||
|
func put_vector3(value:Vector3) -> void:
|
||
|
var pos:PackedFloat64Array = PackedFloat64Array()
|
||
|
pos.append(value.x)
|
||
|
pos.append(value.y)
|
||
|
pos.append(value.z)
|
||
|
data += pos.to_byte_array()
|
||
|
|
||
|
|
||
|
func push(dataEnet:ENetPacketPeer, channel:int, flags:int) -> Error:
|
||
|
return dataEnet.send(channel, data, flags)
|