Closed nlbuescher closed 4 years ago
Although I don't have any real issue with making them public, why is this preventing easy conversion? You can still use the enum in when expressions and in Map
s. You also have the ordinal of the enum if you just want an integer.
I have an inline class Key(val value: Int)
that has its values defined in the companion (so pseudo enum). These values are already defined as the GLFW keycodes. If I had access to KeyboardKey.value
, I would be able to convert with a simple fun Key.Companion.fromGlfw(key: KeyboardKey) = Key(key.value)
. As it stands I'd have to build a map as you say.
It's more of a convenience thing, but since the internal pointer variables of most wrapper classes are also public (cf Window), having just these values be internal seemed odd.
EDIT: I'm testing moving over from using GLFW cinterop to using KGL
Okay, for the sake of consistency I'll remove the internal modifier.
This also applies to MouseButton. Having the value be inaccessible makes it very difficult to convert the library-specific KeyboardKey into a library-agnostic custom class. Making
value
andfrom
public would solve the issue.