Currently I am doing something along the lines of:
public class UselessClass
{
public string x;
public int y;
}
I only ever use this class once in a function...
Dictionary<string, UselessClass> dict;
I'd like to be able to edit the values of the UselessClass, so I believe a Tuple isn't sufficient as they are read-only once created. I'd also like to have the named variables x and y to do things like:
dict["hello"].y++;
Can I do this without having to have this UselessClass sitting around the code when really it's only ever used once for a function? Some sort of anonymous class with named variables?
To add more details:
This is purely used in an algorithmic function where I want to adjoin a string with certain variables, namely another string x and an integer representing a distance
The best way I can think of adding properties to an already existing class like string is by using a dictionary.
Rather than doing:
Dictionary<string, string> names;
Dictionary<string, int> distances;
which seems like a waste of memory, I'd rather get both names and distances in the same structure.
But the structure itself is meaningless on its own, it's only used in the algorithm to perform a calculation.