title: Overriding static field
body: <p>I'm writing a C# game engine for my game, and I've hit a problem.</p>
  
  <p>I need to do a XNA.Rectangle drawRectangle for each different type of block.</p>
  
  <p>Blocks are stored in a list of blocks, so the property, to be accessible by draw without casting a lot, must be overriden.</p>
  
  <p>I've tried lots of ways of doing it, but none work.</p>
  
  <p>Here's the current one I'm doing:</p>
  
  <p>Block.cs</p>
  
  <pre><code>protected static Rectangle m_drawRectangle = new Rectangle(0, 0, 32, 32);
  public Rectangle drawRectangle
  {
      get { return m_drawRectangle; }
  }
  </code></pre>
  
  <p>BlockX.cs</p>
  
  <pre><code>protected static Rectangle m_drawRectangle = new Rectangle(32, 0, 32, 32);
  </code></pre>
  
  <p>However when creating BlockX and accessing <code>drawRectangle</code>, it still returns 0, 0, 32, 32.</p>
  
  <p>Ideally I could just override the <code>drawRectangle</code> member, however doing this would mean creating a member in every single block class. I only want to adjust m_drawRectangle.</p>
  
  <p>Each block will be created hundreds of times so I don't want it to be non-static, and it would be silly to do it in the constructor.</p>
  
  <p>Is there any better way other than just putting a static function to initialise static things in every block?</p>
  
  <p>Edit:</p>
  
  <p>So to sum up, my requirements are:</p>
  
  <ul>
  <li>Minimal extra code in BlockX.cs to override</li>
  <li>Field must stay static</li>
  <li>Preferably not have to override <code>drawRectangle</code>, only <code>m_drawRectangle</code>.</li>
  <li>Not having to create a new rectangle every time the property is accessed</li>
  </ul>