Advertisement

Remove global namespace accessor?

Started by December 26, 2012 03:06 PM
0 comments, last by WitchLord 11 years, 8 months ago

Hey there.

Another simple question I figure I'd place in another thread.

I have some scripts which interface highly out to C++. Now, I added a lot of types which the scripts need to use - however, the code is littered with the global namespace accessor. For instance:


namespace Default
{
	class DefaultRenderer : ::IBlockRenderer
	{
		void Render(::Block block, ::Point3i position)
		{
			::renderer.Draw(::Box().SetAll(::Point2i(0, 0), ::Colorb(255, 0, 255, 255)));
		}
	}
}

Is there any way I can get rid of these? I know it's because these are in a namespace, but, I use them to keep scripts separate and enforce that they be in their own namespace. With them it can't seem to resolve the global scope automatically.

Was this just a design choice?

-P

The namespace feature does not yet support searching in parent namespaces when looking up symbols. I will implement this support, but I haven't gotten to it yet. I wanted to give the basic namespace feature some time to mature first, i.e. time enough for people to use it to find most of the bugs.

I hope to get the time to implement the search in parent namespace early next year (at least the first half of the year).

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement