I want to create an enumeration like object but with an additional "property".
For example I could have a day of the week enumeration:
enum Day {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday };
Now, let's say I have another property I want to store against each day. Something that never changes. For the sake of the argument let's say we have a pay rate which never changes and is 1.5 on Saturday, 2 on Sunday and 1 otherwise.
Can't do this with enumeration. I was thinking of creating a "helper" static class that would just return this second property, but this seems clunky.
static class Rate
{
static float GetRate(Day d)
{
switch (d)
{
case Day.Saturday:
return 1.5f;
case Day.Sunday:
return 2f;
default:
return 1f;
}
}
}
Instead of enum with helper class I could use a ReadOnlyCollection but that seems complicated and heavy-weight for what I need.
What is the best way to go here?