Decouple everything from globals
This commit is contained in:
17
core/currency/currency_catalogue.gd
Normal file
17
core/currency/currency_catalogue.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
class_name CurrencyCatalogue
|
||||
extends Resource
|
||||
|
||||
@export var currencies: Array[Currency] = []
|
||||
|
||||
func get_currency_by_id(id: StringName) -> Currency:
|
||||
for currency in currencies:
|
||||
if currency.id == id:
|
||||
return currency
|
||||
return null
|
||||
|
||||
func get_all_ids() -> Array[StringName]:
|
||||
var ids: Array[StringName] = []
|
||||
for currency in currencies:
|
||||
if currency.id != &"":
|
||||
ids.append(currency.id)
|
||||
return ids
|
||||
1
core/currency/currency_catalogue.gd.uid
Normal file
1
core/currency/currency_catalogue.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://621tus0uvbrd
|
||||
Reference in New Issue
Block a user