I have the following code:
private enum Wall
{
Up = 0x0001,
Down = 0x0010,
Left = 0x0100,
Right = 0x1000,
}
private void Test()
{
int walls = 0x1111;
var wallsWithRightWallRemoved = walls | Wall.Right;
// wallsWithRightWallRemoved should now be this: 0x0111
}
I have a variable called walls where the 0x1111 represents 4 booleans basically. From the walls I want to remove the right wall so I substract it from it (walls | Wall.Right;) , but I am getting "Cannot apply operator & to operands of type int". Basically I want to end up with a variable which contains 0x0111.
Thank you