UNPKG

kraft

Version:

A mysterious command line game with lots of secrets

21 lines (16 loc) 743 B
let Current = 0; const Flow = ['init', 'action', 'gatherings', 'jobs', 'execute', 'end']; const Arguments = require(__base+'helpers/Arguments'); let Kraft = {}; const Matrix = { 'init': (kraft) => { console.log(''); Kraft = kraft; next(); }, 'action': () => require(__base+'model/action/Action').checkCurrentAction(), 'gatherings': () => require(__base+'model/action/Gather').checkCurrentGatherings(), 'jobs': () => require(__base+'model/action/Jobs').checkCurrentJobs(), 'execute': () => Kraft.execute(Arguments.command, Arguments.arguments), 'end': () => { console.log(''); process.exit(0); } }; const init = Matrix['init']; const next = () => Matrix[Flow[++Current]](); exports.init = init; exports.next = next;