|
I have an array of Item with different variables, such as Weight, Value, Name, and junk like that. I know how to use Array.Find() and Array.FindAll() using a boolean predicate, but how would I go about specifically finding an Item by its variable? For example, I want to have a function that can find specific items. public Item GetItem(string itemName) for example, would find the first Item named itemName. What is the most efficient way to do that?
(comments are locked)
|
|
You're probably wanting to use something like a LIST if you want that added functionality. If you're using C#, learning how to use LINQ to form queries is extremely useful and easy to learn as well. A good tutorial for getting started with LINQ would be the following link, by Prime31: ilu <3 Heheh, this will be very handy indeed. I quite understand the grammar of C# fluently, it's just my vocabulary that needs work.
May 17 '12 at 08:51 PM
Nemox
(comments are locked)
|
