UNPKG

puzzlescript

Version:

Play PuzzleScript games in your terminal!

113 lines 3.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GameMetadata = exports.Dimension = void 0; class Dimension { constructor(width, height) { this.width = width; this.height = height; } } exports.Dimension = Dimension; class GameMetadata { constructor() { this.noAction = false; this.noUndo = false; this.noRepeatAction = false; this.scanline = false; this.throttleMovement = false; this.noRestart = false; this.requirePlayerMovement = false; this.verboseLogging = false; this.author = null; this.homepage = null; this.youtube = null; this.zoomscreen = null; this.flickscreen = null; this.colorPalette = null; this.backgroundColor = null; this.textColor = null; this.realtimeInterval = null; this.keyRepeatInterval = null; this.againInterval = null; this.runRulesOnLevelStart = null; } _setValue(key, value) { switch (key.toLowerCase()) { case 'author': this.author = value; break; case 'homepage': this.homepage = value; break; case 'youtube': this.youtube = value; break; case 'zoomscreen': this.zoomscreen = value; break; case 'flickscreen': this.flickscreen = value; break; case 'colorpalette': case 'color_palette': this.colorPalette = value; break; case 'backgroundcolor': case 'background_color': this.backgroundColor = value; break; case 'textcolor': case 'text_color': this.textColor = value; break; case 'realtimeinterval': case 'realtime_interval': this.realtimeInterval = value; break; case 'keyrepeatinterval': case 'key_repeat_interval': this.keyRepeatInterval = value; break; case 'againinterval': case 'again_interval': this.againInterval = value; break; case 'noaction': this.noAction = value; break; case 'noundo': this.noUndo = value; break; case 'runrulesonlevelstart': case 'run_rules_on_level_start': this.runRulesOnLevelStart = value; break; case 'norepeataction': case 'norepeat_action': this.noRepeatAction = value; break; case 'scanline': this.scanline = value; break; case 'throttlemovement': case 'throttle_movement': this.throttleMovement = value; break; case 'norestart': this.noRestart = value; break; case 'requireplayermovement': case 'require_player_movement': this.requirePlayerMovement = value; break; case 'verboselogging': case 'verbose_logging': this.verboseLogging = value; break; default: throw new Error(`BUG: Unsupported config field "${key}" with value "${value}"`); } } } exports.GameMetadata = GameMetadata; //# sourceMappingURL=metadata.js.map