This problem was on / off, and I wrote 4 wrappers. I am sure that I am doing it wrong, and I need to find out where my understanding comes from.
Let's say I use the Rectangle class to represent metal bars. (it works better than animals)
So, the base class is called "Bar".
private class Bar
{
internal Rectangle Area;
}
So. Now we make a rectangle, say 300 units per 10 units.
private Bar CreateBar()
{
Bar1 = new Bar1();
Bar1.Area = new Rectangle(new Point(0,0), new Size(300,10));
return Bar1;
}
Fantastic, so we have a basic panel.
Now let me say that we want this bar to have material - say, steel. So.,.
private class SteelBar : Bar
{
string Material;
}
So, if I did it.,.
private SteelBar CreateSteelBar()
{
SteelBar SteelB = new SteelB();
Bar B = CreateBar();
SteelB = B;
SteelB.Material = "Steel";
return SteelB;
}
, , CreateSteelBar, , CreateBar. , 300 10 . .
- , , . , , , , , , - .
, , SteelBar = CreateBar();, .