import { AppObjectController } from "@vived/core";
import { MouseInputEntity, } from "../../MouseInput";
import { TryHideWithPickUC } from "../UCs/TryHideWithPickUC";
export class HideMC extends AppObjectController {
    get tryHideWithPick() {
        return this.getCachedSingleton(TryHideWithPickUC.type)
            ?.tryPixelPick;
    }
    get mouseInput() {
        return this.getCachedSingleton(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);
    }
}
HideMC.type = "MouseOrbit";
//# sourceMappingURL=HideMC.js.map