"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Action_1 = require("./Action");
const ActionGroup_1 = require("./ActionGroup");
const Location_1 = require("../minecraft/Location");
class TestSimulatedPlayerMoveAction extends Action_1.default {
    get typeTitle() {
        return "Move Simulated Player";
    }
    get typeId() {
        return "test_simulated_player_move";
    }
    get shortSubjectId() {
        return "simplayer";
    }
    get title() {
        if (!this.location) {
            return this.typeTitle;
        }
        return this.typeTitle + " " + this.location.toSummary();
    }
    get location() {
        return this.getArgumentAsLocation("location");
    }
    set location(location) {
        if (!location) {
            this.data["location"] = undefined;
        }
        else {
            this.data["location"] = [location.x, location.y, location.z];
        }
    }
    validate() {
        this.validateArgumentIsType("location", "Location");
        return true;
    }
    getScriptRequirements(options) {
        return {
            needsTest: true,
        };
    }
    getCommandRequirements(options) {
        return {};
    }
    addCommandLines(lines, indent) {
        let location = this.location;
        if (!location) {
            location = new Location_1.default(0, 0, 0);
        }
        location = this.absolutizeLocation(location);
        ActionGroup_1.default.addLine(lines, indent, "tp @p[tag=" + this.getCommandWith() + "]" + location.x + " " + location.y + " " + location.z);
    }
    addScriptLines(lines, options, context, placement) {
        let location = this.location;
        if (!location) {
            location = new Location_1.default(0, 0, 0);
        }
        ActionGroup_1.default.addLine(lines, context.indent, this.getScriptWith() +
            ".moveToLocation(new Location(" +
            location.x +
            ", " +
            location.y +
            ", " +
            location.z +
            "));");
    }
}
exports.default = TestSimulatedPlayerMoveAction;

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