UNPKG

rock-mod

Version:

Rock-Mod is a powerful framework designed for creating and managing mods for Grand Theft Auto (GTA) games.

69 lines (68 loc) 1.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CCMPObject = void 0; const CCMPEntity_1 = require("../entity/CCMPEntity"); const shared_1 = require("../../../../shared"); const Vectors_1 = require("../../../../shared/common/utils/math/Vectors"); const RockMod_1 = require("../../../RockMod"); class CCMPObject extends CCMPEntity_1.CCMPEntity { _ccmpObject; _onDestroy; get id() { return this._ccmpObject.id; } get type() { return shared_1.BaseObjectType.Object; } get isExists() { return this._ccmpObject.isExists; } get position() { const p = this._ccmpObject.position; return new Vectors_1.Vector3D(p.x, p.y, p.z); } get dimension() { return this._ccmpObject.dimension; } get model() { return this._ccmpObject.model; } get rotation() { const r = this._ccmpObject.rotation; return new Vectors_1.Vector3D(r.x, r.y, r.z); } get alpha() { return this._ccmpObject.alpha; } get ccmpMeta() { return this._ccmpObject; } constructor(options) { super(); this._ccmpObject = options.ccmpObject; this._ccmpObject.alpha = options.alpha; this._onDestroy = options.onDestroy; } destroy() { if (!this._ccmpObject.isExists) return; this._ccmpObject.destroy(); this._onDestroy(this); } setPosition(value) { this._ccmpObject.position = { x: value.x, y: value.y, z: value.z }; } setDimension(value) { this._ccmpObject.dimension = value; } setModel(value) { this._ccmpObject.model = RockMod_1.RockMod.instance.utils.hash(value); } setRotation(value) { this._ccmpObject.rotation = { x: value.x, y: value.y, z: value.z }; } setAlpha(value) { this._ccmpObject.alpha = value; } } exports.CCMPObject = CCMPObject;