@tool
extends VendingMachinePrice
class_name VendingMachineEnergyPrice

@export var energy : int

func _init(
    _energy := 1
):
    energy = _energy

func get_icon() -> Texture:
    return preload("res://common/icons/bolt.svg")

func get_text() -> String:
    return "%d" % energy

func can_pay(player_data: PlayerData) -> bool:
    return player_data.energy >= energy

func pay(player_data: PlayerData) -> void:
    player_data.energy -= energy