I'm building a little lwjgl library.
I have a RenderController
, containing all the render objects AND other objects which are Renderable - so I took an Interface, called Renderable - containing the methods render()
and. beforeRenderUpdate()
.
The problem is: the user of the library shouldn't be allowed to call RenderObject#update
, because I want the lib to manage the rendering alone. But I want the user let have instances of this classes, because they sometimes extend AbstractMovableObject
, and the user has to move them or request a uniform update.
So, the option to create an abstract class containing the render method isn't possible.
The advantage of an interfacr
would be, I had one list in RenderController
, objects <Renderable>(x).render()
.
But I don't want to have this render method public. What can I do now? As I sad, an abstract class isn't possible because this classes are extending something else.