Ensure proper initialization of all Arrays and Dictionaries
This commit is contained in:
@@ -17,7 +17,7 @@ enum EducationMethod {
|
||||
@export var account_type: AccountType
|
||||
@export var education_method: EducationMethod
|
||||
var devices_count: int
|
||||
@export var students: Dictionary # int : Array[StudentData]
|
||||
@export var students: Dictionary[int, Array] = {} # int : Array[StudentData]
|
||||
@export var email: String
|
||||
var password: String
|
||||
@export var token: String
|
||||
@@ -50,7 +50,7 @@ func update_from_dict(dict: Dictionary) -> void:
|
||||
students[int(device)] = device_students
|
||||
|
||||
func get_new_code() -> int :
|
||||
var used_codes: Array[int]
|
||||
var used_codes: Array[int] = []
|
||||
for student_array: Array[StudentData] in students.values():
|
||||
for student: StudentData in student_array:
|
||||
used_codes.append(student.code)
|
||||
|
||||
@@ -13,7 +13,7 @@ var consecutives_losses: int = 0
|
||||
@export
|
||||
var consecutives_wins: int = 0
|
||||
@export
|
||||
var history: Array[bool]
|
||||
var history: Array[bool] = []
|
||||
|
||||
func add_game(is_won: bool) -> void:
|
||||
history.append(is_won)
|
||||
|
||||
@@ -4,7 +4,7 @@ class_name UserSpeeches
|
||||
signal speeches_changed
|
||||
|
||||
# Contains the list of speeches already played
|
||||
@export var speeches_played: Array[String]
|
||||
@export var speeches_played: Array[String] = []
|
||||
|
||||
func add_speech(speech: String) -> void:
|
||||
if not speeches_played.has(speech):
|
||||
|
||||
Reference in New Issue
Block a user