Having the following enumeration
enum ColliderType: UInt8 {
case Hero = 0b1
case GoblinOrBoss = 0b10
case Projectile = 0b100
case Wall = 0b1000
case Cave = 0b10000
}
I'm trying to do something very simple:
let combined = ColliderType.Hero.toRaw() | ColliderType.Wall.toRaw()
// test 'combined' for the 'Wall' bitmask
if (combined & ColliderType.Wall.toRaw()) { // Compliation error :[
}
The error I'm getting is as follows
Type 'UInt8' does not conform to protocol 'BooleanType'