title: Restricted access of function in Haxe?
body: <p>I started playing around with Haxe recently, after using AS3 for quite some time and ran into a problem while writing a very simple game engine:</p>
  
  <p>I have a class called <code>World</code>. One of the things the <code>World</code> does, is keeping track of all <code>Entity</code> objects in the game. I want this list of <code>Entity</code> objects to be accessible ONLY from within the engine. The user of the engine should not be able to modify the list directly.</p>
  
  <p>In AS3, I could simply use the <code>internal</code> keyword to give access to other classes within the same package. And when that wasn't enough I could define a custom namespace and use it as my access modifier. But Haxe doesn't seem to have either of those.</p>
  
  <p>TL;DR: How can I restrict access of a variable to a specific package/namespace? If not possible, what other options do I have?</p>