´remove garbage

This commit is contained in:
kookroach
2021-04-04 21:53:51 +02:00
parent 8b21742d64
commit fa81b7fc79
3 changed files with 4 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
import { IEntity, IPlayer, IEntityAttachments, IEntityAttachmentPool, IPlayerPool, IVehicle, IVehiclePool, VehicleSeat, EntityType, IObjectPool, IObject } from "../../game";
import { IEntity, IPlayer, IEntityAttachments, IEntityAttachmentPool, IPlayerPool, IVehicle, IVehiclePool, VehicleSeat, EntityType } from "../../game";
import { parseJson } from "../../util";
import game from "../..";
@@ -190,18 +190,6 @@ class RagePlayerPool implements IPlayerPool {
}
}
class RageObject extends RageEntity implements IObject {
public object: ObjectMp;
public __attachmentData: object;
constructor(object: ObjectMp) {
if (!object) {
throw "Object is undefined"
}
super(object);
this.object = object;
}
}
class RageVehicle extends RageEntity implements IVehicle {
private vehicle: VehicleMp;
@@ -240,36 +228,6 @@ class RageVehicle extends RageEntity implements IVehicle {
}
class RageObjectPool implements IObjectPool {
public attachmentDataMap: Map<ObjectMp, object>;
setData(entity: ObjectMp, attachmentData: object): void {
if (!this.attachmentDataMap)
this.attachmentDataMap = new Map<ObjectMp, object>();
this.attachmentDataMap.set(entity, attachmentData);
}
at(id: number): IObject {
var object = mp.objects.atRemoteId(Number(id));
if (!object)
return null;
return new RageObject(object, this.attachmentDataMap.get(object));
}
forEach(fn: (entity: IObject) => void): void {
mp.objects.forEach(e => {
if (!e) {
game.ui.sendChatMessage("forEach - e is null");
return;
}
fn(new RageObject(e, this.attachmentDataMap.get(e)));
})
}
}
class RageVehiclePool implements IVehiclePool {
at(id: number): IVehicle {
@@ -301,6 +259,5 @@ export {
RageEntityAttachmentPool,
RageVehicle,
RageVehiclePool,
RageObject,
RageObjectPool,
}