"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mockTouchInputEvent = mockTouchInputEvent;
const core_1 = require("@vived/core");
function mockTouchInputEvent(touchPositions) {
    const mockEvt = new TouchEvent("");
    const touchCount = touchPositions.length;
    let sumPos = core_1.Vector2.Zero();
    const touches = touchPositions.map((pos, i) => {
        sumPos = core_1.Vector2.Add(sumPos, pos);
        return {
            id: i,
            position: pos,
        };
    });
    const avgPos = touchCount === 0
        ? core_1.Vector2.Zero()
        : new core_1.Vector2(sumPos.x / touchCount, sumPos.y / touchCount);
    return {
        event: mockEvt,
        touchCenter: avgPos,
        touchCount,
        touches,
    };
}
//# sourceMappingURL=mockTouchInputEvent.js.map