"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Action_1 = require("./Action");
const ActionGroup_1 = require("./ActionGroup");
const IScriptGenerationContext_1 = require("./IScriptGenerationContext");
const Location_1 = require("../minecraft/Location");
class ParticleSpawnAction extends Action_1.default {
    get typeId() {
        return "particle_spawn";
    }
    get particleName() {
        return this.getArgumentAsString("particleName");
    }
    get location() {
        return this.getArgumentAsLocation("location");
    }
    getScriptRequirements() {
        return {
            needsLocalOverworld: true,
        };
    }
    getCommandRequirements() {
        return {};
    }
    addCommandLines(lines, indent, options) {
        if (!this.particleName) {
            return;
        }
        let loc = this.location;
        if (!loc) {
            loc = new Location_1.default(0, 0, 0);
        }
        ActionGroup_1.default.addLine(lines, indent, "particle " + this.particleName + " " + loc.x + " " + loc.y + " " + loc.z);
    }
    addScriptLines(lines, options, context, placement) {
        if (!this.particleName) {
            return;
        }
        if (placement === IScriptGenerationContext_1.ScriptGenerationPlacement.inSequence) {
            let loc = this.location;
            if (!loc) {
                loc = new Location_1.default(0, 0, 0);
            }
            ActionGroup_1.default.addLine(lines, context.indent, 'overworld.spawnParticle("' + this.particleName + '", { x: ' + loc.x + ", y: " + loc.y + ", z: " + loc.z + "});");
        }
    }
    validate() {
        return true;
    }
}
exports.default = ParticleSpawnAction;

//# sourceMappingURL=../maps/actions/ParticleSpawnAction.js.map
