Vendor gdUnit4 for Godot 4 client testing (D-030). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
371 B
GDScript
20 lines
371 B
GDScript
class_name ClassWithEnumConstructor
|
|
extends RefCounted
|
|
|
|
enum MyEnumValue {
|
|
ONE = 10,
|
|
TWO = 20
|
|
}
|
|
|
|
var _value :MyEnumValue = MyEnumValue.ONE
|
|
|
|
|
|
# using an enum in the constructor
|
|
func _init(value :MyEnumValue, _second_parameter :PackedStringArray) -> void:
|
|
_value = value
|
|
|
|
|
|
# using an enum as function argument
|
|
func set_value(value :MyEnumValue) -> void:
|
|
_value = value
|