Hello,
I have a "Dictionary" data base and I want to return an element from a specific location. I saw that there is "ElementAt" function but I didnt manage to use it.
Why doesnt something like that work?
closeHash.ElementAt<State>(i);
it tells me the following error:
Error 3 'System.Collections.Generic.Dictionary' does not contain a definition for 'ElementAt' and the best extension method overload 'System.Linq.Queryable.ElementAt(System.Linq.IQueryable, int)' has some invalid arguments
And this code also doesnt work because closeHash[i] gives me only the index and not the actual element:
if (closeHash.ContainsKey(i) && ((State)closeHash[i]).getH() +
((State)closeHash[i]).getG() > checkState.getH() + checkState.getG()
Each element in the Dictionary is of a class "State" and checkState also is a State that has GetH and GetG Functions. I want to take out the element at the Ith position and work on it and not just remove it.
thanks in advance!
Greg