Panther Search Documentation Tutorials Devlogs Downloads Source Code

Documentation > Panther Documentation > Enums

Enums

Panther
Documentation


  (TODO)

Example

Panther
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
type Direction = enum { // default underlying type is UI32 NORTH, // 0 EAST, // 1 SOUTH = 4, // 4 WEST, // 5 } type Color = enum(UI8) { RED = 1 << 0, GREEN = 1 << 1, BLUE = 1 << 2, func containsRed = (this) -> Bool { return (this & Color.RED) as Bool; } } func entry = () #entry -> UI8 { const purple: Color = Color.RED | Color.BLUE; return purple.containsRed() as UI8; }