I'm looking to compare a value against a list and then set another variable based on this comparison.
My list is
1 = Red
4 = Blue
13 = Green
I could have a series of if statements but with a large list this looks messy
if (Type == 1)
{
Name = "Red";
}
else if (Type == 4)
{
Name = "Blue";
}
else if (Type == 13)
{
Name = "Green";
}
What's an efficient and tidy way to achieve the same?