Refactor code structure for improved readability and maintainability
This commit is contained in:
+5
-9
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user