From 6e1ebeb03a1917954ab8944bd28ac377af78d226 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 00:56:43 -0500 Subject: [PATCH] cleaned PlaneMaskManager --- .../room/object/RoomPlaneBitmapMaskParser.ts | 20 ++++++------- src/nitro/room/object/RoomPlaneData.ts | 30 +++++++++---------- src/nitro/room/object/RoomPlaneParser.ts | 16 +++++----- src/nitro/room/object/logic/room/RoomLogic.ts | 4 +-- .../object/visualization/room/RoomPlane.ts | 2 +- .../visualization/room/RoomVisualization.ts | 6 ++-- .../room/mask/PlaneMaskManager.ts | 10 +++---- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts b/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts index 70f2b93e..e763fdc3 100644 --- a/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts +++ b/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts @@ -11,7 +11,7 @@ export class RoomPlaneBitmapMaskParser this._masks = new Map(); } - public get _Str_6845(): number + public get maskCount(): number { return this._masks.size; } @@ -69,7 +69,7 @@ export class RoomPlaneBitmapMaskParser this._masks.set(k, mask); } - public _Str_23574(k: string): boolean + public removeMask(k: string): boolean { const existing = this._masks.get(k); @@ -85,7 +85,7 @@ export class RoomPlaneBitmapMaskParser return false; } - public _Str_5598(): RoomMapMaskData + public getXML(): RoomMapMaskData { const data = new RoomMapMaskData(); @@ -93,9 +93,9 @@ export class RoomPlaneBitmapMaskParser { if(!mask) continue; - const type = this._Str_21678(mask); - const category = this._Str_21644(mask); - const location = this._Str_19038(mask); + const type = this.getMaskType(mask); + const category = this.getMaskCategory(mask); + const location = this.getMaskLocation(mask); if(type && category && location) { @@ -119,21 +119,21 @@ export class RoomPlaneBitmapMaskParser return data; } - public _Str_19038(mask: RoomPlaneBitmapMaskData): IVector3D + public getMaskLocation(mask: RoomPlaneBitmapMaskData): IVector3D { if(!mask) return null; return mask.loc; } - public _Str_21678(mask: RoomPlaneBitmapMaskData): string + public getMaskType(mask: RoomPlaneBitmapMaskData): string { if(!mask) return null; return mask.type; } - public _Str_21644(mask: RoomPlaneBitmapMaskData): string + public getMaskCategory(mask: RoomPlaneBitmapMaskData): string { if(!mask) return null; @@ -144,4 +144,4 @@ export class RoomPlaneBitmapMaskParser { return this._masks; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/RoomPlaneData.ts b/src/nitro/room/object/RoomPlaneData.ts index 7f410318..7efde482 100644 --- a/src/nitro/room/object/RoomPlaneData.ts +++ b/src/nitro/room/object/RoomPlaneData.ts @@ -119,24 +119,24 @@ export class RoomPlaneData return this._normal; } - public get _Str_25207(): IVector3D + public get normalDirection(): IVector3D { return this._normalDirection; } - public get _Str_20277(): number + public get secondaryNormalCount(): number { return this._secondaryNormals.length; } - public get _Str_6845(): number + public get maskCount(): number { return this._masks.length; } - public _Str_22585(k: number): IVector3D + public getSecondaryNormal(k: number): IVector3D { - if(((k < 0) || (k >= this._Str_20277))) + if(((k < 0) || (k >= this.secondaryNormalCount))) { return null; } @@ -151,18 +151,18 @@ export class RoomPlaneData this._masks.push(_local_5); } - private _Str_8361(k: number):RoomPlaneMaskData + private getMask(k: number):RoomPlaneMaskData { - if(((k < 0) || (k >= this._Str_6845))) + if(((k < 0) || (k >= this.maskCount))) { return null; } return this._masks[k]; } - public _Str_25133(k: number): number + public getMaskLeftSideLoc(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.leftSideLoc; @@ -170,9 +170,9 @@ export class RoomPlaneData return -1; } - public _Str_23609(k: number): number + public getMaskRightSideLoc(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.rightSideLoc; @@ -180,9 +180,9 @@ export class RoomPlaneData return -1; } - public _Str_25097(k: number): number + public getMaskLeftSideLength(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.leftSideLength; @@ -190,9 +190,9 @@ export class RoomPlaneData return -1; } - public _Str_25617(k: number): number + public getMaskRightSideLength(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.rightSideLength; diff --git a/src/nitro/room/object/RoomPlaneParser.ts b/src/nitro/room/object/RoomPlaneParser.ts index 0f802a80..cc5464d2 100644 --- a/src/nitro/room/object/RoomPlaneParser.ts +++ b/src/nitro/room/object/RoomPlaneParser.ts @@ -1407,7 +1407,7 @@ export class RoomPlaneParser if(!planeData) return null; - return planeData._Str_25207; + return planeData.normalDirection; } public getPlaneSecondaryNormals(k: number): IVector3D[] @@ -1423,9 +1423,9 @@ export class RoomPlaneParser { _local_3 = []; _local_4 = 0; - while(_local_4 < _local_2._Str_20277) + while(_local_4 < _local_2.secondaryNormalCount) { - _local_3.push(_local_2._Str_22585(_local_4)); + _local_3.push(_local_2.getSecondaryNormal(_local_4)); _local_4++; } return _local_3; @@ -1452,7 +1452,7 @@ export class RoomPlaneParser if(!planeData) return 0; - return planeData._Str_6845; + return planeData.maskCount; } public getPlaneMaskLeftSideLoc(k: number, _arg_2: number): number @@ -1463,7 +1463,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_25133(_arg_2); + return planeData.getMaskLeftSideLoc(_arg_2); } public getPlaneMaskRightSideLoc(k: number, _arg_2: number): number @@ -1474,7 +1474,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_23609(_arg_2); + return planeData.getMaskRightSideLoc(_arg_2); } public getPlaneMaskLeftSideLength(k: number, _arg_2: number): number @@ -1485,7 +1485,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_25097(_arg_2); + return planeData.getMaskLeftSideLength(_arg_2); } public getPlaneMaskRightSideLength(k: number, _arg_2: number): number @@ -1496,7 +1496,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_25617(_arg_2); + return planeData.getMaskRightSideLength(_arg_2); } public addFloorHole(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number): void diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index 07ced056..50604fcb 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -260,12 +260,12 @@ export class RoomLogic extends RoomObjectLogicBase update = true; break; case ObjectRoomMaskUpdateMessage._Str_10260: - update = this._planeBitmapMaskParser._Str_23574(message.maskId); + update = this._planeBitmapMaskParser.removeMask(message.maskId); break; } - if(update) _arg_2.setValue(RoomObjectVariable.ROOM_PLANE_MASK_XML, this._planeBitmapMaskParser._Str_5598()); + if(update) _arg_2.setValue(RoomObjectVariable.ROOM_PLANE_MASK_XML, this._planeBitmapMaskParser.getXML()); } private onObjectRoomPlaneVisibilityUpdateMessage(message: ObjectRoomPlaneVisibilityUpdateMessage, model: IRoomObjectModel): void diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index b5d4c5c8..2f84c822 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -453,7 +453,7 @@ export class RoomPlane implements IRoomPlane if(mask) { - const planeMask = this._maskManager._Str_8361(mask.type); + const planeMask = this._maskManager.getMask(mask.type); if(planeMask) { diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 26009171..0b9e594c 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -895,9 +895,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements for(const mask of this._roomPlaneBitmapMaskParser.masks.values()) { - const maskType = this._roomPlaneBitmapMaskParser._Str_21678(mask); - const maskLocation = this._roomPlaneBitmapMaskParser._Str_19038(mask); - const maskCategory = this._roomPlaneBitmapMaskParser._Str_21644(mask); + const maskType = this._roomPlaneBitmapMaskParser.getMaskType(mask); + const maskLocation = this._roomPlaneBitmapMaskParser.getMaskLocation(mask); + const maskCategory = this._roomPlaneBitmapMaskParser.getMaskCategory(mask); if(maskLocation) { diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts index b56b6b00..431f7de9 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts @@ -51,10 +51,10 @@ export class PlaneMaskManager this._assetCollection = k; - this._Str_22834(this.data, k); + this.parseMasks(this.data, k); } - private _Str_22834(k: any, _arg_2: IGraphicAssetCollection): void + private parseMasks(k: any, _arg_2: IGraphicAssetCollection): void { if(!k || !_arg_2) return; @@ -90,7 +90,7 @@ export class PlaneMaskManager if(maskVisualization) { - const assetName = this._Str_25815(visualization.bitmaps, maskVisualization, _arg_2); + const assetName = this.parseMaskBitmaps(visualization.bitmaps, maskVisualization, _arg_2); newMask.setAssetName(size, assetName); } @@ -108,7 +108,7 @@ export class PlaneMaskManager } } - private _Str_25815(k: any, _arg_2: PlaneMaskVisualization, _arg_3: IGraphicAssetCollection): string + private parseMaskBitmaps(k: any, _arg_2: PlaneMaskVisualization, _arg_3: IGraphicAssetCollection): string { if(!k || !k.length) return null; @@ -187,7 +187,7 @@ export class PlaneMaskManager return true; } - public _Str_8361(k: string): PlaneMask + public getMask(k: string): PlaneMask { if(!this._masks || !this._masks.size) return null;