forked from BigfootDev/flatbuffers
Add enum name lookup method to Java/C# enums
Tested: on Linux for Java and C# Bug: 15781151 Change-Id: I7cb97bcc01d986cac2b24aaf7cb29521ddaa2f6b
This commit is contained in:
@@ -5,8 +5,12 @@ namespace MyGame.Example
|
||||
|
||||
public class Any
|
||||
{
|
||||
public static byte NONE = 0;
|
||||
public static byte Monster = 1;
|
||||
public static readonly byte NONE = 0;
|
||||
public static readonly byte Monster = 1;
|
||||
|
||||
private static readonly string[] names = { "NONE", "Monster", };
|
||||
|
||||
public static string Name(int e) { return names[e]; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user