Is it possible to overload an operator with both the addend and augend (lhs & rhs) as user defined enum types? I have two enums defined as:
And I'd like to be able to do this:Code:public enum Rotate { CLOCKWISE, COUNTER_CLOCKWISE } public enum Direction { NORTH, EAST, SOUTH, WEST }
I am new to C# (obviously). If this is possible, what is the syntax?Code:Direction d = Direction.NORTH; d += Rotate.CLOCKWISE; // Now d should be Direction.EAST d += Rotate.COUNTER_CLOCKWISE; d += Rotate.COUNTER_CLOCKWISE; // Now d should be Direction.WEST
Thanks,
--
Scott




Reply With Quote