bashor
11/10/2017, 10:51 AMDeactivated User
11/10/2017, 10:57 AMFoo { bitone = 0b001, bittwo = 0b010 ... }
. In C# you can mark an enum like that. In the end you do things like: Foo.one | Foo.two
and you still have a Foo
bashor
11/10/2017, 11:01 AMDeactivated User
11/10/2017, 11:01 AMDeactivated User
11/10/2017, 11:02 AMbashor
11/10/2017, 11:16 AMexternal sealed class MyEnum {
object Foo : MyEnum
object Bar : MyEnum
}
fun MyEnum.toInt() = this.unsafeCast<Int>()
// TODO check that we have such entry and throw if overwise
fun Int.toMyEnum() = this.unsafeCast<MyEnum>()
Deactivated User
11/10/2017, 11:18 AM