❔ 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?
atakancracker
atakancracker2y ago
Does this list wraps primitive types ?
HumNumWorld
HumNumWorld2y 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
atakancracker
atakancracker2y ago
so its List<string> right now
HumNumWorld
HumNumWorld2y ago
yes and only stores names
atakancracker
atakancracker2y 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
HumNumWorld2y ago
I have to be able to create new plants while running, would class let me do that is this a list class?
atakancracker
atakancracker2y ago
yes List of Plant class
HumNumWorld
HumNumWorld2y ago
ok cool so I can do plants[0] and get the class?
atakancracker
atakancracker2y ago
yes you can access items by index like that or use LINQ
atakancracker
atakancracker2y ago
HumNumWorld
HumNumWorld2y 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
HumNumWorld2y 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
More Posts