| 1 |
func test(): |
| 2 |
var type: Variant.Type |
| 3 |
type = Variant.Type.TYPE_INT |
| 4 |
print(type) |
| 5 |
type = TYPE_FLOAT |
| 6 |
print(type) |
| 7 |
|
| 8 |
var direction: ClockDirection |
| 9 |
direction = ClockDirection.CLOCKWISE |
| 10 |
print(direction) |
| 11 |
direction = COUNTERCLOCKWISE |
| 12 |
print(direction) |
| 13 |
|
| 14 |
var duper := Duper.new() |
| 15 |
duper.set_type(Variant.Type.TYPE_INT) |
| 16 |
duper.set_type(TYPE_FLOAT) |
| 17 |
duper.set_direction(ClockDirection.CLOCKWISE) |
| 18 |
duper.set_direction(COUNTERCLOCKWISE) |
| 19 |
|
| 20 |
class Super: |
| 21 |
func set_type(type: Variant.Type) -> void: |
| 22 |
print(type) |
| 23 |
func set_direction(dir: ClockDirection) -> void: |
| 24 |
print(dir) |
| 25 |
|
| 26 |
class Duper extends Super: |
| 27 |
func set_type(type: Variant.Type) -> void: |
| 28 |
print(type) |
| 29 |
func set_direction(dir: ClockDirection) -> void: |
| 30 |
print(dir) |