Thomas changed the topic of #kspmodding to: Welcome to #kspmodding - the channel for discussing, and learning about, modding Kerbal Space Program. Code of Conduct: https://git.io/vSQh6 | Always provide logs. | *** PSA: https://kerbalspaceprogram.com/api/index.html | <Red5> Guy was asked for a log file, he gave this link: http://pastebin.com/wfVarZPf | If you haven't read it yet: Logs :P
regex has quit [Remote host closed the connection]
<pizzaoverhead>
Sigma88: There's only one instance of the list. You can't access it as myClassInstance3.MyList, it'll be MyClass.MyList
<Sigma88>
that's fine
<Sigma88>
which brings me to my next question
<Sigma88>
I have a Base class and two more classes derived from the first
<Sigma88>
FirstClass
<Sigma88>
SecondClass : FirstClass
<Sigma88>
like that
<Sigma88>
can I get a static list for each of those classes?
<Sigma88>
possibly a List<> of the class itself?
<Sigma88>
I just define 3 different lists I suppose
<pizzaoverhead>
This sounds like one of those situations where it's better to ask what you're trying to achieve, rather than how to do one of the possible ways of doing it
<pizzaoverhead>
Derived classes are the base class plus extras, so MyClass.MyList and MyDerivedClass.MyList are the same list.
<Sigma88>
yeah, basically I'm working on making TR a bit more modular
<Sigma88>
I made a class for Suits
<Sigma88>
this class includes most notably some properties and an array of Texture2D
<Sigma88>
I need the same basic structure for other objects that are part of the suit
<Sigma88>
like helmet and jetpack
<Sigma88>
so, my idea is to have a database of all Suits, one of all Helmets, and one of all Jetpacks
<Sigma88>
Helmet and Jetpack are derived from Suit
<pizzaoverhead>
You could have an EvaEquipment class, with Suit, Helmet and Jetpack derived from that instead.
<pizzaoverhead>
A derived class should be a kind of the base class. For example, it wouldn't make sense to have a "public int NumberOfArms" field for your Helmet
<Sigma88>
yes, but if I can manage to put everything in the class itself, I can then have a Populate() method
<Sigma88>
that loads the DB from cfg
<Sigma88>
automatically
<Sigma88>
yeah all stuff included in the base class is needed for helmets and jetpacks as well
<Sigma88>
there's no specific stuff
<Sigma88>
I could just have one single class and 3 lists
<Sigma88>
but I liked the idea of having different classes because it's easier to understand, I think
<pizzaoverhead>
Being able to understand it in 6 months time is very valuable :)
<Sigma88>
I was just wondering if there was a way to avoid having to define the lists that way
<pizzaoverhead>
You've got to balance readability, maintainability etc. (tech debt) with actually getting the project finished before the heat death of the universe. It is a constant struggle :)
<Sigma88>
it's not even my project :D
<Sigma88>
I just enjoy writing code
<Sigma88>
even if it doesn't get released I'm fine with it
<pizzaoverhead>
That's a fun way to be :)
<pizzaoverhead>
I gotta run, enjoy!
<Sigma88>
plus I learn a lot of cool stuff
<Sigma88>
0/
pizzaoverhead is now known as pi|Zzz|aoverhead
<pi|Zzz|aoverhead>
\o
<Sigma88>
I still don't know if it's possible to do what I want :D
<Sigma88>
if anybody else has an idea ping me
<Sigma88>
otherwise I'll just keep the lists defined separately