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,16 +1,16 @@
extends State
class_name SnailEating
@onready var snail = get_parent().get_parent() as Snail # I think this is bad but I dont care it works
@onready var snail : Snail = get_parent().get_parent() as Snail # I think this is bad but I dont care it works
func enter(_msg := {}):
func enter(_msg : Dictionary = {}) -> void:
Log.pr("I am a snail...")
snail.eating = true
func exit():
func exit() -> void:
snail.eating = false
func update(_delta : float):
func update(_delta : float) -> void:
pass
func physics_update(_delta : float) -> void:

View file

@ -1,15 +1,15 @@
extends State
class_name SnailSleeping
@onready var snail = get_parent().get_parent() as Snail # I think this is bad but I dont care it works
@onready var snail : Snail = get_parent().get_parent() as Snail # I think this is bad but I dont care it works
func enter(_msg := {}):
func enter(_msg : Dictionary = {}) -> void:
Log.pr("I am a snail asleep...")
func exit():
func exit() -> void:
pass
func update(_delta : float):
func update(_delta : float) -> void:
pass
func physics_update(_delta : float) -> void: