Refactor code structure for improved readability and maintainability

This commit is contained in:
Kirill
2026-05-31 10:57:44 +03:00
parent edb5ec9dfa
commit c21048add3
12 changed files with 179 additions and 194 deletions
+5 -9
View File
@@ -23,8 +23,9 @@ func cycle(delta: float) -> void:
func produce(item_id: String, amount: int) -> void:
if item_id == "S" or item_id == 'H':
entities[item_id].amount += 1
#if item_id == "S" or item_id == 'H':
#entities[item_id].amount += 1
entities[item_id].amount += amount
var entity: OwniverseEntity = entities[item_id]
_process_enitity(entity, amount)
@@ -54,15 +55,10 @@ func _check_locked_items() -> void:
for elem in entity.unlock:
if cumulative_amount[elem] < entity.unlock[elem]:
continue
print(entity.id, " ", elem, ":", entity.unlock[elem])
#print(entity.id, " ", elem, ":", entity.unlock[elem])
unlock_item.emit(entity.id)
locked_entities.erase(entity)
# unlock here
return
return # SIC!
#endregion