J
John Salerno
Ok, concerning my little pet project...I have int arrays of the
following sizes:
panel[][,]
AND
panel[][][,]
They are static fields right now, and I'm wondering if it's possible
(and better) to make them separate classes/objects of type Panel.
First off, here's the information for the object:
There are four panels (represented by the first index with values 0-3).
There are eight switches on each panel (second index, 0-7).
Each switch controls twenty lights that may or may not turn on (third
index ranging from [0,0] to [1,9]).
So, my questions:
1. If I make this an object rather than a static field, should it be a
struct or class? It's integers, but I'm guessing the fact that it's an
array means it's a class.
2. Should it inherit from ArrayList?
3. How do represent the index values when making a class? Can you create
complex indexers like [][][,]?
4. Is it possible to create properties like this:
panel.SecondPanel.ThirdSwitch.FifthLight?
If so, how do I define those properties so that they return the proper
value?
One thought is that the static field gets moved to the Panel class, and
the class works with it internally, but I still don't know how to
implement all this.
Thanks.
following sizes:
panel[][,]
AND
panel[][][,]
They are static fields right now, and I'm wondering if it's possible
(and better) to make them separate classes/objects of type Panel.
First off, here's the information for the object:
There are four panels (represented by the first index with values 0-3).
There are eight switches on each panel (second index, 0-7).
Each switch controls twenty lights that may or may not turn on (third
index ranging from [0,0] to [1,9]).
So, my questions:
1. If I make this an object rather than a static field, should it be a
struct or class? It's integers, but I'm guessing the fact that it's an
array means it's a class.
2. Should it inherit from ArrayList?
3. How do represent the index values when making a class? Can you create
complex indexers like [][][,]?
4. Is it possible to create properties like this:
panel.SecondPanel.ThirdSwitch.FifthLight?
If so, how do I define those properties so that they return the proper
value?
One thought is that the static field gets moved to the Panel class, and
the class works with it internally, but I still don't know how to
implement all this.
Thanks.