11func set_money(value:int) -> void:
16func add_money(amount:int) -> void:
17 set_money(money + amount)
21func can_spend(amount:int) -> bool:
22 return money >= amount
26func spend(amount:int) -> bool:
27 if amount < 0
or not can_spend(amount):
34func get_state() -> Dictionary:
35 return {
"money": money}
39func apply_state(state:Dictionary, default_money:int = 350) -> void:
40 set_money(
int(state.get(
"money", default_money)))
int
Return saveable economy state.