Refactor code structure for improved readability and maintainability

This commit is contained in:
Kirill
2026-07-19 15:41:44 +03:00
parent 2a64274322
commit a81359c1e6
24 changed files with 27 additions and 27 deletions
+22 -22
View File
@@ -41,28 +41,28 @@ HG|hypergiant|ui/2-stars/|2|2|4|
WD|white_dwarf|ui/2-stars/|2|3|0|
NS|neutron_star|ui/2-stars/|2|3|1|
MGT|magnetar|ui/2-stars/|2|3|2|
BH|blackhole|ui/2-stars/|2|3|3|
SMBH|supermassive_blackhole|ui/2-stars/|2|3|4|
SCD|starclusterscattered|ui/3-structures/|3|0|0|
SCS|starclustersmall|ui/3-structures/|3|0|1|
SCM|starclustermedium|ui/3-structures/|3|0|2|
SCL|starclusterlarge|ui/3-structures/|3|0|3|
SCG|starclustergiant|ui/3-structures/|3|0|4|
GED|galaxyellipticaldwarf|ui/3-structures/|3|1|0|
GES|galaxyellipticalsmall|ui/3-structures/|3|1|1|
GEM|galaxyellipticalmedium|ui/3-structures/|3|1|2|
GEL|galaxyellipticallarge|ui/3-structures/|3|1|3|
GEG|galaxyellipticalgiant|ui/3-structures/|3|1|4|
GSD|galaxyspiraldwarf|ui/3-structures/|3|2|0|
GSS|galaxyspiralsmall|ui/3-structures/|3|2|1|
GSM|galaxyspiralmedium|ui/3-structures/|3|2|2|
GSL|galaxyspirallarge|ui/3-structures/|3|2|3|
GSG|galaxyspiralgiant|ui/3-structures/|3|2|4|
LGG|galacticgroup|ui/3-structures/|3|3|0|
LSC|galacticsupercluster|ui/3-structures/|3|3|1|
LGF|galacticfilament|ui/3-structures/|3|3|2|
LGW|galacticwall|ui/3-structures/|3|3|3|
LUB|universebubble|ui/3-structures/|3|3|4|
BH|black_hole|ui/2-stars/|2|3|3|
SMBH|supermassive_black_hole|ui/2-stars/|2|3|4|
SCD|star_cluster_scattered|ui/3-structures/|3|0|0|
SCS|star_cluster_small|ui/3-structures/|3|0|1|
SCM|star_cluster_medium|ui/3-structures/|3|0|2|
SCL|star_cluster_large|ui/3-structures/|3|0|3|
SCG|star_cluster_giant|ui/3-structures/|3|0|4|
GED|galaxy_elliptical_dwarf|ui/3-structures/|3|1|0|
GES|galaxy_elliptical_small|ui/3-structures/|3|1|1|
GEM|galaxy_elliptical_medium|ui/3-structures/|3|1|2|
GEL|galaxy_elliptical_large|ui/3-structures/|3|1|3|
GEG|galaxy_elliptical_giant|ui/3-structures/|3|1|4|
GSD|galaxy_spiral_dwarf|ui/3-structures/|3|2|0|
GSS|galaxy_spiral_small|ui/3-structures/|3|2|1|
GSM|galaxy_spiral_medium|ui/3-structures/|3|2|2|
GSL|galaxy_spiral_large|ui/3-structures/|3|2|3|
GSG|galaxy_spiral_giant|ui/3-structures/|3|2|4|
LGG|galactic_group|ui/3-structures/|3|3|0|
LSC|galactic_super_cluster|ui/3-structures/|3|3|1|
LGF|galactic_filament|ui/3-structures/|3|3|2|
LGW|galactic_wall|ui/3-structures/|3|3|3|
LUB|universe_bubble|ui/3-structures/|3|3|4|
GG|gas_giant|ui/4-life/|4|0|0|
AB|asteroid_belt|ui/4-life/|4|0|1|
RP|rocky_planet|ui/4-life/|4|0|2|
+5 -5
View File
@@ -4,8 +4,8 @@ class_name Owniverse
signal unlock_item(item_id: String)
var current_year: float = 0
var current_speed: int = 1
var current_speed_in_years:int = 1
var current_speed: float = 1
var current_speed_in_years:float = 1
var entities: Dictionary[String, OwniverseEntity] = {}
var entity_groups: Dictionary[String, Array] = {}
@@ -86,8 +86,8 @@ func produce(item_id: String, amount: float) -> void:
func automated_production(_delta: float) -> void:
for entity_id in auto_production:
var entity = entities[entity_id]
var amount_to_produce = int(entity.amount * entity.product_per_year_amount * _delta)
var _entity = entities[entity_id]
var _amount_to_produce = int(_entity.amount * _entity.product_per_year_amount * _delta)
func get_available_to_produce(item_id: String) -> float:
@@ -140,7 +140,7 @@ func add_time_delta(delta) -> float:
return current_year
func change_speed(delta: int) -> int:
func change_speed(delta: int) -> float:
current_speed = clamp(current_speed + delta, 1, Global.SPEED_LIMIT)
current_speed_in_years = pow(10, current_speed - 1)
return current_speed