Skip to content

Instantly share code, notes, and snippets.

View logalleon's full-sized avatar
🍄

Logan S. logalleon

🍄
View GitHub Profile
@logalleon
logalleon / Authors.json
Created May 12, 2022 13:59
A list of generate authors.
[
{
"name": "Alexander Collins",
"id": 0
},
{
"name": "Stout Brady",
"id": 1
},
{
enum DwarfStatus {
NO_JOB = 'NO_JOB',
NO_DESTINATION = 'NO_DESTINATION',
SLEEPING = 'SLEEPING',
ACTIVE = 'ACTIVE',
LEGENDARY = 'LEGENDARY',
HUNGRY = 'HUNGRY',
THIRSTY = 'THIRSTY',
DROWSY = 'DROWSY',
MADNESS = 'MADNESS',
const renderMap: RenderMap = {
[DwarfStatus.NO_JOB]: { char : 'n' },
[DwarfStatus.NO_DESTINATION]: { char: 'ø' },
['something']: { char: 'y' }
}
enum DwarfStatus {
NO_JOB = 'NO_JOB',
NO_DESTINATION = 'NO_DESTINATION',
SLEEPING = 'SLEEPING',
ACTIVE = 'ACTIVE'
}
const renderMap: RenderMap = {
[DwarfStatus[DwarfStatus.NO_JOB]]: { char : 'n' },
[DwarfStatus[DwarfStatus.NO_DESTINATION]]: { char: 'ø' }
};
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 = {}));
const renderMap: RenderMap = {
[DwarfStatus.NO_DESTINATION]: { char: 'ø' }
}
renderMap[DwarfStatus.NO_JOB] = { char: 'n' };
function fn (status: DwarfStatus): void {
switch (status) {
case DwarfStatus.ACTIVE:
break;
case DwarfStatus.NO_DESTINATION:
break;
case DwarfStatus.NO_JOB:
break;
default:
_never(status);
function fn (status: DwarfStatus): void {
switch (status) {
case DwarfStatus.ACTIVE:
break;
case DwarfStatus.NO_DESTINATION:
break;
case DwarfStatus.NO_JOB:
break;
}
}
function fn (status: DwarfStatus): void {
switch (status) {
case DwarfStatus.ACTIVE:
/* ... do things */
}
}