"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HideMC = void 0;
const core_1 = require("@vived/core");
const MouseInput_1 = require("../../MouseInput");
const TryHideWithPickUC_1 = require("../UCs/TryHideWithPickUC");
class HideMC extends core_1.AppObjectController {
    get tryHideWithPick() {
        return this.getCachedSingleton(TryHideWithPickUC_1.TryHideWithPickUC.type)
            ?.tryPixelPick;
    }
    get mouseInput() {
        return this.getCachedSingleton(MouseInput_1.MouseInputEntity.type);
    }
    constructor(appObject) {
        super(appObject, HideMC.type);
        this.allow = (e) => {
            if (e.button !== 0) {
                return false;
            }
            return true;
        };
        this.onClick = (e) => {
            if (!this.tryHideWithPick)
                return;
            if (!this.allow(e))
                return;
            this.tryHideWithPick(e.position);
        };
        this.mouseInput?.registerController(this);
    }
}
exports.HideMC = HideMC;
HideMC.type = "MouseOrbit";
//# sourceMappingURL=HideMC.js.map