title: Member cannot be accessed with an instance reference; qualify it with a type name instead
body: <p>I have a game. It has a <code>Level</code> class for drawing the level, managing blocks, etc. I also have a <code>Tile</code> class for each individual tile (type, x, y), and a block class for the type of block.</p>
  
  <p>I get the error: </p>
  
  <p><code>Member cannot be accessed with an instance reference; qualify it with a type name instead</code></p>
  
  <p>In</p>
  
  <pre><code>Texture2D texture = tiles[x, y].blockType.Dirt_Block.texture;
  </code></pre>
  
  <p>Here is my Tile.cs</p>
  
  <pre><code>using System;
  using Microsoft.Xna.Framework;
  using Microsoft.Xna.Framework.Graphics;
  using Game.Tiles;
  
  namespace Game
  {
  public struct Tile
  {
      public BlockType blockType;
      public  int X;
      public  int Y;
  
      /// &lt;summary&gt;
      /// Creates a new tile for one position
      /// &lt;/summary&gt;
      /// &lt;param name="blocktype"&gt;Type of block&lt;/param&gt;
      /// &lt;param name="x"&gt;X Axis position&lt;/param&gt;
      /// &lt;param name="y"&gt;Y Axis position&lt;/param&gt;
      public Tile(BlockType blocktype,int x,int y)
      {
          blockType = blocktype;
          X = x;
          Y = y;
      }
  }
  }
  </code></pre>
  
  <p>And block.cs...</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using Microsoft.Xna.Framework;
  using Microsoft.Xna.Framework.Graphics;
  using Microsoft.Xna.Framework.Content;
  using Game.Tiles;
  
  
  namespace Game.Tiles
  {
  
  /// &lt;summary&gt;
  /// Controls the collision detection and response behavior of a tile.
  /// &lt;/summary&gt;
  enum BlockCollision
  {
      /// &lt;summary&gt;
      /// A passable tile is one which does not hinder player motion at all.
      /// &lt;/summary&gt;
      Passable = 0,
  
      /// &lt;summary&gt;
      /// An impassable tile is one which does not allow the player to move through
      /// it at all. It is completely solid.
      /// &lt;/summary&gt;
      Impassable = 1,
  
      /// &lt;summary&gt;
      /// A platform tile is one which behaves like a passable tile except when the
      /// player is above it. A player can jump up through a platform as well as move
      /// past it to the left and right, but can not fall down through the top of it.
      /// &lt;/summary&gt;
      Platform = 2,
  }
  public enum BlockType
  {
       Dirt_Block = new Block("Dirt Block",,BlockCollision.Impassable,250,0,0)
  }
  /// &lt;summary&gt;
  /// Stores the appearance and collision behavior of a tile.
  /// &lt;/summary&gt;
  public struct Block
  {
  
      public static string Name;
      public static Texture2D Texture;
      public static BlockCollision Collision;
      public static int Width = 16;
      public static int Height = 16;
      public static int maxAmount;
      public static int Worth;
      public static int Strength;
  
      public static Vector2 Size = new Vector2(Width, Height);
  
      /// &lt;summary&gt;
      /// Contructs a new block
      /// &lt;/summary&gt;
      /// &lt;param name="name"&gt;Name of the block&lt;/param&gt;
      /// &lt;param name="texture"&gt;Texture to use as image&lt;/param&gt;
      /// &lt;param name="collision"&gt;Collision type&lt;/param&gt;
      /// &lt;param name="maxamount"&gt;Maximum amount of these blocks you can have&lt;/param&gt;
      /// &lt;param name="worth"&gt;How much this block is worth&lt;/param&gt;
      /// &lt;param name="strength"&gt;How hard the block is (how much you will have to hit to mine it)&lt;/param&gt;
      public Block(string name, Texture2D texture,BlockCollision collision, int       maxamount, int worth, int strength)
      {
          Name = name;
          Texture = texture;
          Collision = collision;
          Width = 16;
          Height = 16;
          maxAmount = maxamount;
          Worth = worth;
          Strength = strength;
      }
  }
  }
  </code></pre>
  
  <p>I'm not even sure if its an efficient way to make a <code>new tile(blockType,x,y)</code> for every block on the grid. Any help would be appreciated. Mainly; How can I get the value of <code>blockType.Dirt_Block.Texture</code>? But I get the error about something not being static or whatever.</p>
  
  <p><a href="http://pastebin.com/s50AB6kz" rel="nofollow">http://pastebin.com/s50AB6kz</a></p>
  
  <p><strong>EDIT:</strong> Looking back at this I feel really stupid, but I will leave it here since obviously 10k views means it has helped someone</p>