Thanks for the assistance. I tried it that way, but it just didn't work quite well with some of the stuff I am doing inside my program.
I found that Extension Methods is what I needed. With enumeration and other bits, I can now do exactly what I wanted, and the code is much more readable than I even thought it would be!
I just have one issue right now...
The class(es) have now become:
Code:
public class SystemClass
{
//got a constructor
private int _Owner;
public int Owner
{
get { return _Owner; }
set { _Owner= value }
}
//...there's more like this, with limits, exceptions and stuff
}
so I'd create it with:
Code:
SystemClass[] system= new SystemClass[600]; // you think i'm kidding...?
for (int i = 0; i < 600 ; i++ )
{
system[i] = new SystemClass();
}
However, I want a property/variable called AdjSystem, to be an array of size 7. So I'd write it as system[x].AdjSystem[y] . This is the only one in this style, as I am wanting the ability to iterate through the number of adjacent systems this system has. I currently have this in the constructor:
Code:
public SystemClass
{
public SystemClass()
{
int[] _AdjSystem = new int[7];
//... and other bits in here
}
private int[] _AdjSystem;
public int AdjSystem
{
get{...}
set{...}
}
}
This only initialises as null, not the desired array. How can I do this?