extends Area2D

export var modifier :Resource

var modifier_type = 0


#var state_timeout: Timer

# Declare member variables here. Examples:
# var a = 2
# var b = "text"

#var modifier :StateModifier
#var modifier_properties: ModifierProperties


# Called when the node enters the scene tree for the first time.
func _ready():
	assert(modifier is StateModifier)
#	modifier = StateModifier.new()
#	modifier.ready( modifier_name, animation_name , modifier.TYPE.NONE, timeout_seconds)
#	modifier.modifier_properties = ModifierProperties.new( move_speed,
#										gravity_modifier, 
#										move_acceleration,
#										move_speed_modifier,
#										move_modifier_move_acceleration,
#										jerk_factor)

func _on_Modifier_Component_body_entered(body):
	var colliding_node = body
	if colliding_node.has_node("Modifier_Receiver"):
		colliding_node.get_node("Modifier_Receiver").register_modifier(modifier)


func _on_Modifier_Component_body_exited(body):
	var colliding_node = body
	if colliding_node.has_node("Modifier_Receiver"):
		colliding_node.get_node("Modifier_Receiver").remove_modifier(modifier)
