extends Node

@export var vehicle_scene: PackedScene

var host_vehicle: VehicleNode


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	Signals.requested_host_vehicle.connect(_on_host_vehicle_requested)
	host_vehicle = vehicle_scene.instantiate()
	host_vehicle.host = true
	add_child(host_vehicle)
	Signals.vehicle_added.emit(host_vehicle)

func _on_host_vehicle_requested(requester: Node):
	if host_vehicle != null:
		requester.set_host_vehicle(host_vehicle)
