<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Automatic XNB serialization and *Content classes</title><link>http://blogs.msdn.com/shawnhar/archive/2009/07/02/automatic-xnb-serialization-and-content-classes.aspx</link><description>Automatic XNB serialization works best when the same classes are available at content build time and at runtime. Pedantic correction: if you are making an Xbox game, they can't actually be the SAME classes. You must compile the code twice , once for use</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Automatic XNB serialization and *Content classes</title><link>http://blogs.msdn.com/shawnhar/archive/2009/07/02/automatic-xnb-serialization-and-content-classes.aspx#9815910</link><pubDate>Fri, 03 Jul 2009 07:26:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9815910</guid><dc:creator>Kevin Gadd</dc:creator><description>&lt;p&gt;Thank you for posting about this! Figuring out this problem was driving me crazy until you shared the solution on the forums. Hopefully this blog post will save other people some stress.&lt;/p&gt;
</description></item><item><title>re: Automatic XNB serialization and *Content classes</title><link>http://blogs.msdn.com/shawnhar/archive/2009/07/02/automatic-xnb-serialization-and-content-classes.aspx#9816738</link><pubDate>Fri, 03 Jul 2009 16:06:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9816738</guid><dc:creator>Nez</dc:creator><description>&lt;p&gt;Thats a really great solution. My only worry (which isnt exactly huge) is that you still cant constrain T - Texture2D and Texture2DContent are completely different classes, so you still rely on someone getting it right at both ends (which you do with all content loading). &lt;/p&gt;
&lt;p&gt;But its definitely a better solution. I guess its just my pedantic nature to try to stop silly people doing things like Sprite&amp;lt;Audio&amp;gt; or some such nonsense :)&lt;/p&gt;</description></item><item><title>re: Automatic XNB serialization and *Content classes</title><link>http://blogs.msdn.com/shawnhar/archive/2009/07/02/automatic-xnb-serialization-and-content-classes.aspx#9821680</link><pubDate>Tue, 07 Jul 2009 09:15:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9821680</guid><dc:creator>Roonda</dc:creator><description>&lt;p&gt;I tend to use (yet) another option which looks a bit like this:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public class Sprite&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public Rectangle Rectangle;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public string TextureName;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public Texture2D Texture;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void Init(ContentManager content)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Texture = content.Load&amp;lt;Texture2D&amp;gt;(TextureName);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;That extra string variable does annoy me though. I think I'll experiment with the generic solution. Thanks for the post Shawn.&lt;/p&gt;
</description></item><item><title>re: Automatic XNB serialization and *Content classes</title><link>http://blogs.msdn.com/shawnhar/archive/2009/07/02/automatic-xnb-serialization-and-content-classes.aspx#9843791</link><pubDate>Tue, 21 Jul 2009 23:04:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9843791</guid><dc:creator>john</dc:creator><description>&lt;p&gt;Lol Shawn, well written and great content. Thankyou.&lt;/p&gt;</description></item></channel></rss>