class_name Level extends Node

@onready var rules = get_node("RulesComponent") as RulesComponent
@onready var bee_spawner = get_node("BeeSpawner") as BeeSpawner
@onready var ui_controls = get_node("UiComponent") as UIComponent

func _ready():
	update_game_state()

func update_game_state():
	GameState.required_nectar = rules.game_rules.nectar_required
	GameState.level_par = rules.game_rules.level_par
	GameState.level_number = rules.game_rules.level_number
	GameState.bees_available = rules.game_rules.bees_available
	ui_controls.update_level_text("Level : " + str(rules.game_rules.level_number))
	ui_controls.update_par_text("Par : " + str(rules.game_rules.level_par))
	bee_spawner.max_bees = rules.game_rules.bees_available
