Jump to content
  • Advertisement
Sign in to follow this  
Napivo

Replacing IDrawable and IUpdateble

This topic is 2620 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The thing I hate most about XNA are the interfaces IDrawable and IUpdatable, they are completely useless.

I have my own implementations of them. iDrawable and iUpdatable. Honestly they are extended versions that I use with my own update and draw managers.

Of course that works just fine except that they old ones still exist and that interfaces should start with a capital 'I'. furthermore it is kind of confusing for outsiders. Since they have nothing to do with one another yet almost are the same.

Is there any way to not load the interfaces, or disable them is some way or is the only way to get around this, changing the names of my interfaces to ICanDraw, INapivoDraw or .... I don't know.

Suggestions for naming these interfaces would be welcome.

Share this post


Link to post
Share on other sites
Advertisement

The thing I hate most about XNA are the interfaces IDrawable and IUpdatable, they are completely useless.

I have my own implementations of them. iDrawable and iUpdatable. Honestly they are extended versions that I use with my own update and draw managers.

Of course that works just fine except that they old ones still exist and that interfaces should start with a capital 'I'. furthermore it is kind of confusing for outsiders. Since they have nothing to do with one another yet almost are the same.

Is there any way to not load the interfaces, or disable them is some way or is the only way to get around this, changing the names of my interfaces to ICanDraw, INapivoDraw or .... I don't know.

Suggestions for naming these interfaces would be welcome.


Just use namespaces properly, this is why they exist.


namespace Foo
{
interface IDrawable { // stuff }
}


elsewhere

class Bar : Foo.IDrawable { // stuff }

Share this post


Link to post
Share on other sites


Just use namespaces properly, this is why they exist.


namespace Foo
{
interface IDrawable { // stuff }
}


elsewhere

class Bar : Foo.IDrawable { // stuff }

[/quote]

I really don't want to be typing Napivo.Xna.Core.IDrawable all over my code or resolve the name conflict everytime I need both Namespaces which is about everywhere... Maybe I am just too lazy.

And yes I know I can shorten it to NXC.IDrawable If I use "using NXC = Napivo.Xna.Core;"

Share this post


Link to post
Share on other sites

I really don't want to be typing Napivo.Xna.Core.IDrawable all over my code or resolve the name conflict everytime I need both Namespaces which is about everywhere... Maybe I am just too lazy.

And yes I know I can shorten it to NXC.IDrawable If I use "using NXC = Napivo.Xna.Core;"


Then remove the Microsoft.XNA.Framework using statement, as long as you don't need it. If you need it and you have naming clashes, this is how things work. If you never want to use a namespace name, then I suggest not using any libraries.

What is wrong with the existing interfaces anyway? It seems lightweight and straight forward.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!