Chnage FXGL type from class to interface? #1192
Unanswered
chengenzhao
asked this question in
Q&A
Replies: 1 comment
-
Hi, the only use case I can think of for this is to get all methods into the scope of the class extending FXGL, but the same can be achieved with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi:
Currently we use Java to write the game
![截屏2022-07-31 下午5 58 33](https://user-images.githubusercontent.com/5525436/182021005-f600877d-26f1-44f8-92da-87a9bee04153.png)
but one problem is we are unable to extend FXGL class
and it won't be a problem if we use Kotlin as long as we use extension
but it is a problem in Java world, we could only use extends to expand the type while FXGL has private constructor so it doesn't allow us to extends the class
so is it possible to change FXGL type from class to interface?
All methods in the FXGL are @JVMStatic, and Java supports static method in the interface now
so I think it should be fine to use interface instead of class with private constructor
Thanks
Beta Was this translation helpful? Give feedback.
All reactions