hey, can anyone explain to me why this works?
class_name FSBaseCharacter
enum attribute_type { STRENGTH, DEXTERITY, CONSTITUTION, INTELLIGENCE, WISDOM, CHARISMA }
var stats = {
attribute_type.STRENGTH : 10,
attribute_type.CONSTITUTION : 10,
attribute_type.DEXTERITY : 10,
attribute_type.INTELLIGENCE : 10,
attribute_type.WISDOM : 10,
attribute_type.CHARISMA : 10
}
static func attribute_string_to_enum(var name: String) -> int:
return attribute_type[name.to_upper()]
I thought you couldn't call stuff like variables outside the scope of the static function in godot. furthermore, another static function is calling this static function, i thought you couldn't do that?