lookup_signal.gd 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. signal hello
  2. func get_signal() -> Signal:
  3. return hello
  4. class A:
  5. signal hello
  6. func get_signal() -> Signal:
  7. return hello
  8. class B:
  9. signal hello
  10. func get_signal() -> Signal:
  11. return hello
  12. class C extends A.B:
  13. func get_signal() -> Signal:
  14. return hello
  15. func test():
  16. var a: = A.new()
  17. var b: = A.B.new()
  18. var c: = C.new()
  19. var hello_a_result: = hello == a.get_signal()
  20. var hello_b_result: = hello == b.get_signal()
  21. var hello_c_result: = hello == c.get_signal()
  22. var a_b_result: = a.get_signal() == b.get_signal()
  23. var a_c_result: = a.get_signal() == c.get_signal()
  24. var b_c_result: = b.get_signal() == c.get_signal()
  25. var c_c_result: = c.get_signal() == c.get_signal()
  26. print("hello == A.hello? %s" % hello_a_result)
  27. print("hello == A.B.hello? %s" % hello_b_result)
  28. print("hello == C.hello? %s" % hello_c_result)
  29. print("A.hello == A.B.hello? %s" % a_b_result)
  30. print("A.hello == C.hello? %s" % a_c_result)
  31. print("A.B.hello == C.hello? %s" % b_c_result)
  32. print("C.hello == C.hello? %s" % c_c_result)