Refactor: Added explicit typing and void return types
- Introduced explicit typing to variables and functions across multiple scripts for better code clarity. - Specified 'void' as the return type for functions that do not return a value. - Removed redundant code in some scripts.
This commit is contained in:
parent
a62cd6018e
commit
2a9e78b52e
37 changed files with 216 additions and 248 deletions
|
|
@ -14,7 +14,7 @@ const SCENES : Dictionary = {
|
|||
|
||||
var loading_scene_res : Resource = null
|
||||
|
||||
func _ready():
|
||||
func _ready() -> void:
|
||||
## LOAD GAME DATA
|
||||
HighScoreMgr.load()
|
||||
HighScoreMgr.debug_output()
|
||||
|
|
@ -25,7 +25,7 @@ func _ready():
|
|||
SceneMgr.connect("change_scene", Callable(self, "_on_change_scene"))
|
||||
$TransitionScene.connect("transitioned", Callable(self, "_on_transition_scene_transitioned"))
|
||||
|
||||
func _on_change_scene(scene_name):
|
||||
func _on_change_scene(scene_name : String) -> void:
|
||||
Log.pr("Going to load a scene.", scene_name)
|
||||
if SCENES.has(scene_name):
|
||||
GameState.reset()
|
||||
|
|
@ -35,6 +35,6 @@ func _on_change_scene(scene_name):
|
|||
else:
|
||||
loading_scene_res = null
|
||||
|
||||
func _on_transition_scene_transitioned():
|
||||
func _on_transition_scene_transitioned() -> void:
|
||||
$CurrentScene.get_child(0).queue_free()
|
||||
$CurrentScene.add_child(loading_scene_res.instantiate())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue