extends Node

###SYNC PLAYER###
const PLAYER_STATE_SIZE = 13
var player_state:
	get:
		var buf = PackedByteArray()
		buf.resize(PLAYER_STATE_SIZE)
		buf.encode_half(0, sync_position.x)
		buf.encode_half(2, sync_position.y)
		buf.encode_half(4, sync_position.z)
		buf.encode_half(6, sync_velocity.x)
		buf.encode_half(8, sync_velocity.y)
		buf.encode_half(10, sync_velocity.z)
		return buf
	set(value):
		assert(typeof(value) == TYPE_PACKED_BYTE_ARRAY and value.size() == PLAYER_STATE_SIZE,
		"Invalid `player_state` array type or size (must be TYPE_PACKED_BYTE_ARRAY of size 11).")
		sync_position = Vector3(value.decode_half(0), value.decode_half(2), value.decode_half(4))
		sync_velocity = Vector3(value.decode_half(6), value.decode_half(8), value.decode_half(10))

var sync_position : Vector3:
	set(value):
		sync_position = value
		processed_position = false
var sync_velocity : Vector3
var sync_is_jumping : bool

var processed_position : bool


