You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
950 B

extends Resource
class_name MajorityJudgmentGrade
"""
A single grade.
Could be just an int or a string,
but let's go full oriented object.
PERHAPS ALREADY DEPRECATED
Supports localization (l10n).
Default language is Esperanto. Videoludemuloj!
"""
# Perhaps we'll drop these shenanigans
# and use tr() instead, we'll see.
export(Dictionary) var localized_names:Dictionary
# This is set by the gradation this grade is included in
# 0: worst grade
# more: better grade (up to gradation size minus one)
export(int) var worth := 0
# We use a factory, since ResourceLoader won't like parameters in _init()
static func make(__name):
# var grade = MajorityJudgmentGrade.new() # cyclic :3
var grade = load("res://addons/majority_judgment/MajorityJudgmentGrade.gd").new()
grade.set_name(__name)
return grade
func set_name(__name):
if __name is String:
__name = {'eo_EO': __name}
assert(__name is Dictionary)
self.localized_names = __name