"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HideTC = void 0;
const core_1 = require("@vived/core");
const Entities_1 = require("../../TouchController/Entities");
const TryHideWithPickUC_1 = require("../UCs/TryHideWithPickUC");
class HideTC extends core_1.AppObjectController {
    get tryHideWithPick() {
        return this.getCachedSingleton(TryHideWithPickUC_1.TryHideWithPickUC.type)
            ?.tryPixelPick;
    }
    get touchInput() {
        return this.getCachedSingleton(Entities_1.TouchInputEntity.type);
    }
    constructor(appObject) {
        super(appObject, HideTC.type);
        this.allow = (e) => {
            return true;
        };
        this.onTap = (e) => {
            if (!this.tryHideWithPick)
                return;
            if (!this.allow(e))
                return;
            this.tryHideWithPick(e.touchCenter);
        };
        this.touchInput?.registerController(this);
    }
}
exports.HideTC = HideTC;
HideTC.type = "HideTC";
//# sourceMappingURL=HideTC.js.map