extends Area2D
class_name BellowBridgeArea

var is_character_bellow_bridge: bool = false
var character_body: Node2D = null

func _on_body_entered(_body: Node2D) -> void:
	self._set_character_body_bellow_bridge(_body, true)

func _on_body_exited(_body: Node2D) -> void:
	self._set_character_body_bellow_bridge(_body, false)
	
func _set_character_body_bellow_bridge(_body: Node2D, _state: bool) -> void:
	if _body is BaseCharacter:
		self.is_character_bellow_bridge = _state
		self.character_body = _body
		print("bellow bridge: " + str(_state))

func get_character_body_bellow_bridge() -> bool:
	return self.is_character_bellow_bridge
	
func get_body() -> Node2D:
	return self.character_body
