UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

35 lines 1.18 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const GameService_1 = __importDefault(require("./services/GameService")); class InFlightEntertainment { static activeGameCount = 0; static game; static setup(options) { this.game = new GameService_1.default(options.command, options.ui); } static start(intro) { if (this.activeGameCount > 0) { this.activeGameCount++; return; } this.activeGameCount = 1; void this.game?.play(intro ?? [ `I gotta install some dependencies to get things working.`, `This can be slow, so in the mean time, enjoy some games! 🤩`, ]); } static writeStatus(message) { this.game?.setStatusMessage(`⏱ ${message}`); } static stop() { this.activeGameCount--; if (this.activeGameCount === 0) { this.game?.kill(); } } } exports.default = InFlightEntertainment; //# sourceMappingURL=InFlightEntertainment.js.map