cleaned PlaneMaskManager

This commit is contained in:
Dank074 2021-06-12 00:56:43 -05:00
parent 9c3e213b3d
commit 6e1ebeb03a
7 changed files with 44 additions and 44 deletions

View File

@ -11,7 +11,7 @@ export class RoomPlaneBitmapMaskParser
this._masks = new Map(); this._masks = new Map();
} }
public get _Str_6845(): number public get maskCount(): number
{ {
return this._masks.size; return this._masks.size;
} }
@ -69,7 +69,7 @@ export class RoomPlaneBitmapMaskParser
this._masks.set(k, mask); this._masks.set(k, mask);
} }
public _Str_23574(k: string): boolean public removeMask(k: string): boolean
{ {
const existing = this._masks.get(k); const existing = this._masks.get(k);
@ -85,7 +85,7 @@ export class RoomPlaneBitmapMaskParser
return false; return false;
} }
public _Str_5598(): RoomMapMaskData public getXML(): RoomMapMaskData
{ {
const data = new RoomMapMaskData(); const data = new RoomMapMaskData();
@ -93,9 +93,9 @@ export class RoomPlaneBitmapMaskParser
{ {
if(!mask) continue; if(!mask) continue;
const type = this._Str_21678(mask); const type = this.getMaskType(mask);
const category = this._Str_21644(mask); const category = this.getMaskCategory(mask);
const location = this._Str_19038(mask); const location = this.getMaskLocation(mask);
if(type && category && location) if(type && category && location)
{ {
@ -119,21 +119,21 @@ export class RoomPlaneBitmapMaskParser
return data; return data;
} }
public _Str_19038(mask: RoomPlaneBitmapMaskData): IVector3D public getMaskLocation(mask: RoomPlaneBitmapMaskData): IVector3D
{ {
if(!mask) return null; if(!mask) return null;
return mask.loc; return mask.loc;
} }
public _Str_21678(mask: RoomPlaneBitmapMaskData): string public getMaskType(mask: RoomPlaneBitmapMaskData): string
{ {
if(!mask) return null; if(!mask) return null;
return mask.type; return mask.type;
} }
public _Str_21644(mask: RoomPlaneBitmapMaskData): string public getMaskCategory(mask: RoomPlaneBitmapMaskData): string
{ {
if(!mask) return null; if(!mask) return null;
@ -144,4 +144,4 @@ export class RoomPlaneBitmapMaskParser
{ {
return this._masks; return this._masks;
} }
} }

View File

@ -119,24 +119,24 @@ export class RoomPlaneData
return this._normal; return this._normal;
} }
public get _Str_25207(): IVector3D public get normalDirection(): IVector3D
{ {
return this._normalDirection; return this._normalDirection;
} }
public get _Str_20277(): number public get secondaryNormalCount(): number
{ {
return this._secondaryNormals.length; return this._secondaryNormals.length;
} }
public get _Str_6845(): number public get maskCount(): number
{ {
return this._masks.length; 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; return null;
} }
@ -151,18 +151,18 @@ export class RoomPlaneData
this._masks.push(_local_5); 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 null;
} }
return this._masks[k]; 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) if(_local_2 != null)
{ {
return _local_2.leftSideLoc; return _local_2.leftSideLoc;
@ -170,9 +170,9 @@ export class RoomPlaneData
return -1; 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) if(_local_2 != null)
{ {
return _local_2.rightSideLoc; return _local_2.rightSideLoc;
@ -180,9 +180,9 @@ export class RoomPlaneData
return -1; 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) if(_local_2 != null)
{ {
return _local_2.leftSideLength; return _local_2.leftSideLength;
@ -190,9 +190,9 @@ export class RoomPlaneData
return -1; 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) if(_local_2 != null)
{ {
return _local_2.rightSideLength; return _local_2.rightSideLength;

View File

@ -1407,7 +1407,7 @@ export class RoomPlaneParser
if(!planeData) return null; if(!planeData) return null;
return planeData._Str_25207; return planeData.normalDirection;
} }
public getPlaneSecondaryNormals(k: number): IVector3D[] public getPlaneSecondaryNormals(k: number): IVector3D[]
@ -1423,9 +1423,9 @@ export class RoomPlaneParser
{ {
_local_3 = []; _local_3 = [];
_local_4 = 0; _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++; _local_4++;
} }
return _local_3; return _local_3;
@ -1452,7 +1452,7 @@ export class RoomPlaneParser
if(!planeData) return 0; if(!planeData) return 0;
return planeData._Str_6845; return planeData.maskCount;
} }
public getPlaneMaskLeftSideLoc(k: number, _arg_2: number): number public getPlaneMaskLeftSideLoc(k: number, _arg_2: number): number
@ -1463,7 +1463,7 @@ export class RoomPlaneParser
if(!planeData) return -1; if(!planeData) return -1;
return planeData._Str_25133(_arg_2); return planeData.getMaskLeftSideLoc(_arg_2);
} }
public getPlaneMaskRightSideLoc(k: number, _arg_2: number): number public getPlaneMaskRightSideLoc(k: number, _arg_2: number): number
@ -1474,7 +1474,7 @@ export class RoomPlaneParser
if(!planeData) return -1; if(!planeData) return -1;
return planeData._Str_23609(_arg_2); return planeData.getMaskRightSideLoc(_arg_2);
} }
public getPlaneMaskLeftSideLength(k: number, _arg_2: number): number public getPlaneMaskLeftSideLength(k: number, _arg_2: number): number
@ -1485,7 +1485,7 @@ export class RoomPlaneParser
if(!planeData) return -1; if(!planeData) return -1;
return planeData._Str_25097(_arg_2); return planeData.getMaskLeftSideLength(_arg_2);
} }
public getPlaneMaskRightSideLength(k: number, _arg_2: number): number public getPlaneMaskRightSideLength(k: number, _arg_2: number): number
@ -1496,7 +1496,7 @@ export class RoomPlaneParser
if(!planeData) return -1; 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 public addFloorHole(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number): void

View File

@ -260,12 +260,12 @@ export class RoomLogic extends RoomObjectLogicBase
update = true; update = true;
break; break;
case ObjectRoomMaskUpdateMessage._Str_10260: case ObjectRoomMaskUpdateMessage._Str_10260:
update = this._planeBitmapMaskParser._Str_23574(message.maskId); update = this._planeBitmapMaskParser.removeMask(message.maskId);
break; 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 private onObjectRoomPlaneVisibilityUpdateMessage(message: ObjectRoomPlaneVisibilityUpdateMessage, model: IRoomObjectModel): void

View File

@ -453,7 +453,7 @@ export class RoomPlane implements IRoomPlane
if(mask) if(mask)
{ {
const planeMask = this._maskManager._Str_8361(mask.type); const planeMask = this._maskManager.getMask(mask.type);
if(planeMask) if(planeMask)
{ {

View File

@ -895,9 +895,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements
for(const mask of this._roomPlaneBitmapMaskParser.masks.values()) for(const mask of this._roomPlaneBitmapMaskParser.masks.values())
{ {
const maskType = this._roomPlaneBitmapMaskParser._Str_21678(mask); const maskType = this._roomPlaneBitmapMaskParser.getMaskType(mask);
const maskLocation = this._roomPlaneBitmapMaskParser._Str_19038(mask); const maskLocation = this._roomPlaneBitmapMaskParser.getMaskLocation(mask);
const maskCategory = this._roomPlaneBitmapMaskParser._Str_21644(mask); const maskCategory = this._roomPlaneBitmapMaskParser.getMaskCategory(mask);
if(maskLocation) if(maskLocation)
{ {

View File

@ -51,10 +51,10 @@ export class PlaneMaskManager
this._assetCollection = k; 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; if(!k || !_arg_2) return;
@ -90,7 +90,7 @@ export class PlaneMaskManager
if(maskVisualization) 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); 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; if(!k || !k.length) return null;
@ -187,7 +187,7 @@ export class PlaneMaskManager
return true; return true;
} }
public _Str_8361(k: string): PlaneMask public getMask(k: string): PlaneMask
{ {
if(!this._masks || !this._masks.size) return null; if(!this._masks || !this._masks.size) return null;