Jump to content
  • Advertisement
Sign in to follow this  
AndrewH

[xna] Content.Load and enum serialization

This topic is 2541 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 tried to search for this on the internet but no luck. I love using enums, and the content pipeline is making it difficult for me to add them in my xml files. Why?

Everywhere I went people said the IntermediateSerializer is what the content pipeline uses behind-the-scenes when reading general xml files, but I'm not certain that's 100% the case.

I have an object that has an enum in it. I use the IntermediateSerializer to read and write the object and it stores enums just fine. I use enums for all kinds of things.

But then when I decide to load the xml from the content pipeline it says it can't find the ContentTypeReader for the particular enum. I like to use the pipeline to load data into the xbox, I think intermediate serializer was Windows only.... Which makes sense, so the content pipeline must not use it, which means all of those people (random googled results) were kinda wrong about it.

My only way around this is to not use enums (I'm thinking ints now) for the ContentPipeline xml files. But why is this happening? The IntermediateSerializer can load and save these files just fine (I use it for the game editor). However, the Content Pipeline complains. I'm not writing a custom reader or writer for something it should already be doing!

Share this post


Link to post
Share on other sites
Advertisement
Nevermind, I forgot to build the xml with the content pipeline. It was referencing an old xml file that didn't even contain the enum in question.

I feel really dumb now.

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!