Access control

This topic contains 0 replies, has 1 voice, and was last updated by  nerobot 2 years, 7 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #3693

    nerobot
    Participant

    I want to hide some func in my framework from end user, but want to use them inside framework.

    For example, I have 2 classes – Scene and SceneManager.

    Scene has protected constructor to prevent scene creation outside of SceneManager. Also Scene has methods like Start, Update, Draw – protected.

    How can I access to these protected methods inside of SceneManager?

    My current solution is to create helper class in private section of file (here: SceneManager.monkey2) and use them to get access:

    This class extends Scene – so we can use protected methods.

    Who knows better solution?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.