❔ Help with choosing between ArrayList and other types of collections
I was challenged to make a pokémon styled game without using classes and I wanted to know better ways to store pokémons and their respective moves. Maybe a 2D array? I'm not sure. Also, the variable and method names are in Italian.
9 Replies
easy: do not ever ever ever ever use ArrayList
(which, by the way, is a class)
depending on what you want to do with the items, you might want an array, enumerable, or list.
why exactly?
I didn't clarify well enough: I cannot CREATE classes myself
it is a 30 year old class and has been superceded by multiple classes
List<T>
, T[]
oh
sorry
I started coding in c# less than a week ago so I know basically nothing
The main reasons to avoid it is because ArrayList isn't generic.
very strange requirement for working in c#
are you allowed to use structs or records
yep
I know
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.