UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

43 lines (42 loc) 1.21 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Utilities_1 = __importDefault(require("../core/Utilities")); const ActionError_1 = __importDefault(require("./ActionError")); class ActionSetScope { parent; test; world; errors = []; state = {}; getState(name) { const result = this.state[name]; if (!result && this.parent) { return this.parent.getState(name); } return result; } setState(name, val) { if (Utilities_1.default.isUsableAsObjectKey(name)) { this.state[name] = val; } } addError(action, message) { const error = new ActionError_1.default(action, message); this.addErrorDirect(error); } addErrorDirect(error) { this.errors.push(error); if (this.parent) { this.parent.addErrorDirect(error); } } createBlockLocation(name) { const val = this.getState(name); if (val instanceof Array) { } } } exports.default = ActionSetScope;