I am storing a class "Tag" and a string "tag name" into a dictionary list. This is an example of something I am storing in that list:
Tag apply_t = new Tag("<apply>");
tagteam.Add(apply_t, "apply");
I can check the line if what I am getting has the characters I want...
I am passing the content below into the function that my if statements further down are in
char[][] arr = File.ReadAllLines(path).Select(l => l.ToCharArray()).ToArray();
string line1tag = "" + arr[0][1] + arr[0][2] + arr[0][3] + arr[0][4];
ReturnTag(line1tag);
Onward...
if ((line == "a" + "p" + "p" + "l" + "y") || (line == "apply"))
{
Debug.Log(line);
}
else
{
Debug.Log("trying my best");
}
BUT I really need it to be more dynamic than this... I want to be able to say something like
if (line == tagteam.ContainsKey())
{
}
Since I am storing a class and a string name in the dictionary, how do I check for that?
I was thinking something like a temp Tag but I didn't know how to make that work.
Any thoughts?
TL;DR: The goal is to be able to read the string attached to the line, then to compare it to the dictionary and find the match. My problem is that I have a class with a string name on it right now. It gives me the error "Cannot convert from string to parseML.Tag".