This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum DwarfStatus { | |
| NO_JOB = 'NO_JOB', | |
| NO_DESTINATION = 'NO_DESTINATION', | |
| SLEEPING = 'SLEEPING', | |
| ACTIVE = 'ACTIVE', | |
| LEGENDARY = 'LEGENDARY', | |
| HUNGRY = 'HUNGRY', | |
| THIRSTY = 'THIRSTY', | |
| DROWSY = 'DROWSY', | |
| MADNESS = 'MADNESS', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const renderMap: RenderMap = { | |
| [DwarfStatus.NO_JOB]: { char : 'n' }, | |
| [DwarfStatus.NO_DESTINATION]: { char: 'ø' }, | |
| ['something']: { char: 'y' } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum DwarfStatus { | |
| NO_JOB = 'NO_JOB', | |
| NO_DESTINATION = 'NO_DESTINATION', | |
| SLEEPING = 'SLEEPING', | |
| ACTIVE = 'ACTIVE' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const renderMap: RenderMap = { | |
| [DwarfStatus[DwarfStatus.NO_JOB]]: { char : 'n' }, | |
| [DwarfStatus[DwarfStatus.NO_DESTINATION]]: { char: 'ø' } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var DwarfStatus; | |
| (function (DwarfStatus) { | |
| DwarfStatus[DwarfStatus["NO_JOB"] = 0] = "NO_JOB"; | |
| DwarfStatus[DwarfStatus["NO_DESTINATION"] = 1] = "NO_DESTINATION"; | |
| DwarfStatus[DwarfStatus["SLEEPING"] = 2] = "SLEEPING"; | |
| DwarfStatus[DwarfStatus["ACTIVE"] = 3] = "ACTIVE"; | |
| })(DwarfStatus || (DwarfStatus = {})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const renderMap: RenderMap = { | |
| [DwarfStatus.NO_DESTINATION]: { char: 'ø' } | |
| } | |
| renderMap[DwarfStatus.NO_JOB] = { char: 'n' }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fn (status: DwarfStatus): void { | |
| switch (status) { | |
| case DwarfStatus.ACTIVE: | |
| break; | |
| case DwarfStatus.NO_DESTINATION: | |
| break; | |
| case DwarfStatus.NO_JOB: | |
| break; | |
| default: | |
| _never(status); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fn (status: DwarfStatus): void { | |
| switch (status) { | |
| case DwarfStatus.ACTIVE: | |
| break; | |
| case DwarfStatus.NO_DESTINATION: | |
| break; | |
| case DwarfStatus.NO_JOB: | |
| break; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fn (status: DwarfStatus): void { | |
| switch (status) { | |
| case DwarfStatus.ACTIVE: | |
| /* ... do things */ | |
| } | |
| } |
NewerOlder