enum_as_const.gd 764 B

1234567891011121314151617181920212223242526272829
  1. class Outer:
  2. enum OuterEnum { OuterValue = 3 }
  3. const OuterConst := OuterEnum
  4. class Inner:
  5. enum InnerEnum { InnerValue = 7 }
  6. const InnerConst := InnerEnum
  7. static func test() -> void:
  8. print(OuterEnum.size());
  9. print(OuterEnum.OuterValue);
  10. print(OuterConst.size());
  11. print(OuterConst.OuterValue);
  12. print(Outer.OuterEnum.size());
  13. print(Outer.OuterEnum.OuterValue);
  14. print(Outer.OuterConst.size());
  15. print(Outer.OuterConst.OuterValue);
  16. print(InnerEnum.size());
  17. print(InnerEnum.InnerValue);
  18. print(InnerConst.size());
  19. print(InnerConst.InnerValue);
  20. print(Inner.InnerEnum.size());
  21. print(Inner.InnerEnum.InnerValue);
  22. print(Inner.InnerConst.size());
  23. print(Inner.InnerConst.InnerValue);
  24. func test():
  25. Outer.Inner.test()