Possible Duplicate:
C# virtual static method
Idea:
public class Item
{
public Vector2 Position;
virtual static Sprite mySprite;
public void Draw() {Draw mySprite at Position}
}
public class Couch:Item
{
override static Sprite mySprite=someCouchImage;
}
public class Table:Item
{
override static Sprite mySprite=someTableImage;
}
Explanation There are many Tables and Couches in the game world, each with their unique Positions. Each Table has the same Sprite as the next Table. It seems silly that when I have 100 Tables, there are 100 Sprites.
Question Is there a way so that all Tables share the same Sprite without having 100 Sprites (while also being referencable in the Item class?)