Jump to content
  • Advertisement
Sign in to follow this  

Binary Writer and Derived Classes?

This topic is 2785 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

I have a list of shapes that I want to write in binary that all use a base type. What I can't figure out, is how I can write a bunch of different types without making separate lists.

The only thing that would make sense to me, is to pass the binary writter to the shape I'm serializing, but having a write function inside of a class that only works in binary seems kinda tacky doesn't it? This isn't a technical problem at all, I was just wondering if anyone knew of a cleaner way of doing this.

I'm using the XNA framework so, the BinaryWritter is a must use. I'm not a big fan of XML.

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!