Private classes in graphics.monkey

Monkey Forums/Monkey Programming/Private classes in graphics.monkey

invaderJim(Posted 2012) [#1]
I've been trying to work this one out for a couple hours now, and I can't get my head around how the Image class is able to access the Private Surface class in graphics.monkey.

Without looking into its code too deeply, I'm assuming that trans must be giving special treatment to the Image class, but it's more likely that I'm just missing something really obvious. Would anyone be able to shed some light on this one for me before I lose myself even further?

Thanks.

-Jim


NoOdle(Posted 2012) [#2]
umm I might be missing something or not fully understanding your question.... the Image class has a Field surface:Surface. Apologies if this is not what you meant.


invaderJim(Posted 2012) [#3]
Right, but it shouldn't be able to (I don't think), because Surface is private. For instance, when I attempt to create a class in the same fashion, it's not allowed.

Class TestClass
 Field something:Int

Private
 Field surface:Surface
End



invaderJim(Posted 2012) [#4]
Nevermind. It just hit me. It's private in the scope of the graphics module. I think it's time for me to take a break...

Nothing to see here! I'm just a moron!