❔ 2 Dimensional Lists?

This is a big question of mine. Is it possible? Will this solve my problem? Are classes better?
15 Replies
ACiDCA7
ACiDCA72y ago
better for what? what problem?
Cracker
Cracker2y ago
Does this list wraps primitive types ?
HumNumWorld
HumNumWorldOP2y ago
Hey idk what that means so heres the issue I have plants the game lets you create plants and stores the names in a list but I need more every plant stored must have - - name - calories - population
Cracker
Cracker2y ago
so its List<string> right now
HumNumWorld
HumNumWorldOP2y ago
yes and only stores names
Cracker
Cracker2y ago
its common to use class, you can have Plant class and List<Plant> plants and Plant class will have name, calories, population properties
HumNumWorld
HumNumWorldOP2y ago
I have to be able to create new plants while running, would class let me do that is this a list class?
Cracker
Cracker2y ago
yes List of Plant class
HumNumWorld
HumNumWorldOP2y ago
ok cool so I can do plants[0] and get the class?
Cracker
Cracker2y ago
yes you can access items by index like that or use LINQ
Cracker
Cracker2y ago
HumNumWorld
HumNumWorldOP2y ago
sorry it took a bit, whats link? also how do I get the number of items in a class
fortune*
fortune*2y ago
Well, you can use Count property of List<T> object. e.x. apples.Count
HumNumWorld
HumNumWorldOP2y ago
thank you
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server