Clean and hard-typing
This commit is contained in:
@@ -25,8 +25,8 @@ class Flower:
|
||||
|
||||
|
||||
class LessonButton:
|
||||
var position: = Vector2i.ZERO
|
||||
var path_out_position: = Vector2i.ZERO
|
||||
var position: Vector2i = Vector2i.ZERO
|
||||
var path_out_position: Vector2i = Vector2i.ZERO
|
||||
|
||||
func _init(p_position: Vector2i = Vector2i.ZERO, p_path_out_position: Vector2i = Vector2i.ZERO) -> void:
|
||||
position = p_position
|
||||
@@ -49,7 +49,7 @@ enum FirstOrLast {
|
||||
}
|
||||
|
||||
|
||||
@export var color: = 0
|
||||
@export var color: int = 0
|
||||
var flowers: Array[Flower] = []:
|
||||
set = set_flowers
|
||||
@export var flowers_export: Array[Dictionary] = []:
|
||||
@@ -58,32 +58,32 @@ var lesson_buttons: Array[LessonButton] = []:
|
||||
set = set_lesson_buttons
|
||||
@export var lesson_buttons_export: Array[Dictionary] = []:
|
||||
set = set_lesson_buttons_export
|
||||
@export var is_first_or_last: = FirstOrLast.Neither
|
||||
@export var is_first_or_last: FirstOrLast = FirstOrLast.Neither
|
||||
|
||||
|
||||
func set_flowers_export(p_flowers_export: Array[Dictionary]) -> void:
|
||||
flowers_export = p_flowers_export
|
||||
flowers.clear()
|
||||
for flower_dict in flowers_export:
|
||||
for flower_dict: Dictionary in flowers_export:
|
||||
flowers.append(Flower.from_dict(flower_dict))
|
||||
|
||||
|
||||
func set_flowers(p_flowers: Array[Flower]) -> void:
|
||||
flowers = p_flowers
|
||||
flowers_export.clear()
|
||||
for flower in flowers:
|
||||
for flower: Flower in flowers:
|
||||
flowers_export.append(flower.to_dict())
|
||||
|
||||
|
||||
func set_lesson_buttons_export(p_lesson_buttons_export: Array[Dictionary]) -> void:
|
||||
lesson_buttons_export = p_lesson_buttons_export
|
||||
lesson_buttons.clear()
|
||||
for lesson_button_dict in lesson_buttons_export:
|
||||
for lesson_button_dict: Dictionary in lesson_buttons_export:
|
||||
lesson_buttons.append(LessonButton.from_dict(lesson_button_dict))
|
||||
|
||||
|
||||
func set_lesson_buttons(p_lesson_buttons: Array[LessonButton]) -> void:
|
||||
lesson_buttons = p_lesson_buttons
|
||||
lesson_buttons_export.clear()
|
||||
for lesson_button in lesson_buttons:
|
||||
for lesson_button: LessonButton in lesson_buttons:
|
||||
lesson_buttons_export.append(lesson_button.to_dict())
|
||||
|
||||
@@ -37,6 +37,6 @@ func update_scores(minigame_scores: Dictionary) -> void:
|
||||
if new_score >= 0:
|
||||
gps_scores.erase(ID)
|
||||
else:
|
||||
gps_scores[ID] = max(min_score, new_score)
|
||||
gps_scores[ID] = maxi(min_score, new_score)
|
||||
|
||||
score_changed.emit()
|
||||
|
||||
Reference in New Issue
Block a user