rock-mod
Version:
Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.
94 lines (93 loc) • 3.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MockColshapesManager = void 0;
const MockWorldObjectsManager_1 = require("../worldObject/MockWorldObjectsManager");
const Vectors_1 = require("../../../../shared/common/utils/math/Vectors");
const MockCircleColshape_1 = require("./MockCircleColshape");
const MockCuboidColshape_1 = require("./MockCuboidColshape");
const MockCylinderColshape_1 = require("./MockCylinderColshape");
const MockRectangleColshape_1 = require("./MockRectangleColshape");
const MockSphereColshape_1 = require("./MockSphereColshape");
const shared_1 = require("../../../../shared");
class MockColshapesManager extends MockWorldObjectsManager_1.MockWorldObjectsManager {
_nextId;
constructor() {
super({
baseObjectsType: shared_1.BaseObjectType.Colshape,
});
this._nextId = 0;
}
createCircle(options) {
const { range, position, dimension } = options;
const { x, y } = position;
const colshape = new MockCircleColshape_1.MockCircleColshape({
id: this._nextId++,
type: shared_1.BaseObjectType.Colshape,
range,
position: new Vectors_1.Vector3D(x, y, 0),
dimension,
});
this.registerBaseObject(colshape);
return colshape;
}
createCuboid(options) {
const { width, depth, height, position, dimension } = options;
const { x, y, z } = position;
const colshape = new MockCuboidColshape_1.MockCuboidColshape({
id: this._nextId++,
type: shared_1.BaseObjectType.Colshape,
width,
depth,
height,
position: new Vectors_1.Vector3D(x, y, z),
dimension,
});
this.registerBaseObject(colshape);
return colshape;
}
createCylinder(options) {
const { height, range, position, dimension } = options;
const { x, y, z } = position;
const colshape = new MockCylinderColshape_1.MockCylinderColshape({
id: this._nextId++,
type: shared_1.BaseObjectType.Colshape,
range,
height,
position: new Vectors_1.Vector3D(x, y, z),
dimension,
});
this.registerBaseObject(colshape);
return colshape;
}
createRectangle(options) {
const { width, height, position, dimension } = options;
const { x, y } = position;
const colshape = new MockRectangleColshape_1.MockRectangleColshape({
id: this._nextId++,
type: shared_1.BaseObjectType.Colshape,
width,
height,
position: new Vectors_1.Vector3D(x, y, 0),
dimension,
});
this.registerBaseObject(colshape);
return colshape;
}
createSphere(options) {
const { range, position, dimension } = options;
const { x, y, z } = position;
const colshape = new MockSphereColshape_1.MockSphereColshape({
id: this._nextId++,
type: shared_1.BaseObjectType.Colshape,
range,
position: new Vectors_1.Vector3D(x, y, z),
dimension,
});
this.registerBaseObject(colshape);
return colshape;
}
getParticipants() {
return new Set();
}
}
exports.MockColshapesManager = MockColshapesManager;