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:
Dan 2024-05-15 10:42:16 +01:00
parent a62cd6018e
commit 2a9e78b52e
37 changed files with 216 additions and 248 deletions

View file

@ -1,7 +1,7 @@
class_name GameStateManager extends Node
## THIS SHOULD NOT EXIST HERE BUT I AM NOT GOING TO MAKE A NEW CLASS FOR IT RIGHT NOW
@onready var default_cursor := preload("res://resources/cursors/pointer_a.png")
@onready var default_cursor : Resource = preload("res://resources/cursors/pointer_a.png")
var placing_drone : bool = false
@ -59,13 +59,13 @@ var judge_level_par : int = 0 :
get:
## Return an amount of points based on the difference between the number of drones_used and the level_par
## Using more drones than the par is bad and should result in less points
var diff = drones_used - level_par
var diff : int = drones_used - level_par
if diff > 0:
return -diff * 100
else:
return 0
func _process(delta) -> void:
func _process(delta : float) -> void:
if level_started and !level_complete and !game_over:
level_timer += delta