I afraid I'm going to offer code, because it's just much easier they trying to explain. However, the basic idea is that all your elements have the same base class and you keep a list of the base class, unboxing into the more specific classes as needed.
Just off the top of my head, something like this should work.
csharp
// an element of your 8x8 grid
class GalaxyZone {
public int posX;
public int posY;
// things in the grid
// not the type is a base type,
// there can actually be no instances of it
private List<ZoneItem> zoneItems = new List<ZoneItem>();
public List<ZoneItem> ZoneItems { get { return this.zoneItems; } }
}
// basic thing that can be in zone
abstract class ZoneItem {
protected string itemName;
public ZoneItem(string itemName) { this.itemName = itemName; }
// all items with have this properties
public abstract string ItemName { get; }
// we can get this name for out type, but we main want to override it.
public virtual string ItemType { get { return this.GetType().Name; } }
}
// start building various types
// keep in mind that you only need a new class if it has
// properties that are unique to it.
class Star : ZoneItem {
private int size;
private float gravity;
public Star(string itemName, int size, float gravity) : base(itemName) {
this.size = size;
this.gravity = gravity;
}
public int Size { get { return this.size; } }
public float Gravity { get { return this.gravity; } }
}
class Planet : ZoneItem {
private Star star;
public Planet(string itemName, Star star) : base(itemName) {
this.star = star;
}
public Star Star { get { return this.star; } }
}
// example
GalaxyZone gz = new GalaxyZone();
Star sol = new Star("Sun", 1, 1);
gz.ZoneItems.Add(sol);
gz.ZoneItems.Add(new Planet("Earth", sol));
gz.ZoneItems.Add(new Planet("Mars", sol));
Hope this helps.