Files names snake_case

This commit is contained in:
Adrien Ufferte
2025-06-05 16:38:15 +02:00
parent 1600884e76
commit ade9a527f3
49 changed files with 103 additions and 116 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
extends Resource
class_name TeacherSettings
const available_codes: Array[int] = [123, 124, 125, 126, 132, 134, 135, 136, 142, 143, 145, 146, 152, 153, 154, 213, 214, 215, 216, 231, 234, 235, 236, 241, 243, 245, 246, 251, 253, 254, 321, 324, 325, 326, 312, 314, 315, 316, 342, 341, 345, 346, 352, 351, 354, 423, 421, 425, 426, 432, 431, 435, 436, 412, 413, 415, 416, 452, 453, 451, 523, 524, 521, 526, 532, 534, 531, 536, 542, 543, 541, 546, 512, 513, 514, 623, 624, 625, 621, 632, 634, 635, 631, 642, 643, 645, 641, 652, 653, 654]
const AVAILABLE_CODES: Array[int] = [123, 124, 125, 126, 132, 134, 135, 136, 142, 143, 145, 146, 152, 153, 154, 213, 214, 215, 216, 231, 234, 235, 236, 241, 243, 245, 246, 251, 253, 254, 321, 324, 325, 326, 312, 314, 315, 316, 342, 341, 345, 346, 352, 351, 354, 423, 421, 425, 426, 432, 431, 435, 436, 412, 413, 415, 416, 452, 453, 451, 523, 524, 521, 526, 532, 534, 531, 536, 542, 543, 541, 546, 512, 513, 514, 623, 624, 625, 621, 632, 634, 635, 631, 642, 643, 645, 641, 652, 653, 654]
enum AccountType {
@@ -94,10 +94,10 @@ func get_new_code() -> int :
for student: StudentData in student_array:
used_codes.append(student.code)
if used_codes.size() == available_codes.size():
if used_codes.size() == AVAILABLE_CODES.size():
return -1
var codes: Array[int] = available_codes.duplicate()
var codes: Array[int] = AVAILABLE_CODES.duplicate()
for code: int in used_codes:
codes.erase(code)
+8 -8
View File
@@ -1,10 +1,10 @@
extends Resource
class_name UserMinigameHistory
const min_difficulty: int = 0
const max_difficulty: int = 4
const consecutive_wins_to_promote: int = 2
const consecutive_losses_to_demote: int = 2
const MIN_DIFFICULTY: int = 0
const MAX_DIFFICULTY: int = 4
const CONSECUTIVE_WINS_TO_PROMOTE: int = 2
const CONSECUTIVE_LOSSES_TO_DEMOTE: int = 2
@export
var difficulty: int = 0
@@ -20,14 +20,14 @@ func add_game(is_won: bool) -> void:
if is_won:
consecutives_losses = 0
consecutives_wins += 1
if consecutives_wins >= consecutive_wins_to_promote:
if consecutives_wins >= CONSECUTIVE_WINS_TO_PROMOTE:
consecutives_wins = 0
if difficulty != max_difficulty:
if difficulty != MAX_DIFFICULTY:
difficulty += 1
else:
consecutives_wins = 0
consecutives_losses += 1
if consecutives_losses >= consecutive_losses_to_demote:
if consecutives_losses >= CONSECUTIVE_LOSSES_TO_DEMOTE:
consecutives_losses = 0
if difficulty != min_difficulty:
if difficulty != MIN_DIFFICULTY:
difficulty -= 1
+4 -4
View File
@@ -4,10 +4,10 @@ class_name UserRemediation
signal score_changed()
# Defines the minimal score a GP can get, it doesn't go below that point
const min_score: int = -3
const MIN_SCORE: int = -3
# Defines the score from which the GP should be presented for remediation
const remediation_score: int = -2
const REMEDIATION_SCORE: int = -2
# Defines the score for each GP
# Key is the ID of the GP
@@ -19,7 +19,7 @@ var gps_scores: Dictionary[int, int] = {}
# Gets the score of a GP if it is below or equals to the remediation score
func get_gp_score(ID: int) -> int:
if gps_scores.has(ID):
return gps_scores[ID] if gps_scores[ID] <= remediation_score else 0
return gps_scores[ID] if gps_scores[ID] <= REMEDIATION_SCORE else 0
return 0
@@ -37,6 +37,6 @@ func update_gp_scores(minigame_scores: Dictionary) -> void:
if new_gp_score >= 0:
gps_scores.erase(ID)
else:
gps_scores[ID] = maxi(min_score, new_gp_score)
gps_scores[ID] = maxi(MIN_SCORE, new_gp_score)
score_changed.emit()