diff --git a/src/api/asset/IGraphicAssetGifCollection.ts b/src/api/asset/IGraphicAssetGifCollection.ts new file mode 100644 index 00000000..c17b3686 --- /dev/null +++ b/src/api/asset/IGraphicAssetGifCollection.ts @@ -0,0 +1,8 @@ +import { Resource, Texture } from '@pixi/core'; + +export interface IGraphicAssetGifCollection +{ + name: string; + textures: Texture[]; + durations: number[]; +} diff --git a/src/api/asset/index.ts b/src/api/asset/index.ts index 374f7efc..3aacc2e1 100644 --- a/src/api/asset/index.ts +++ b/src/api/asset/index.ts @@ -6,6 +6,7 @@ export * from './IAssetManager'; export * from './IAssetPalette'; export * from './IGraphicAsset'; export * from './IGraphicAssetCollection'; +export * from './IGraphicAssetGifCollection'; export * from './IGraphicAssetPalette'; export * from './logic'; export * from './logic/model'; diff --git a/src/api/nitro/IRoomContentLoader.ts b/src/api/nitro/IRoomContentLoader.ts deleted file mode 100644 index 31cc7ff3..00000000 --- a/src/api/nitro/IRoomContentLoader.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IGraphicAssetCollection } from '../asset'; -import { IEventDispatcher } from '../common'; -import { IRoomObject } from '../room'; - -export interface IRoomContentLoader -{ - dispose: () => void; - downloadAsset(type: string, events: IEventDispatcher): void; - isLoaderType(type: string): boolean; - getCollection(name: string): IGraphicAssetCollection; - getPlaceholderName(type: string): string; - setRoomObjectRoomId(object: IRoomObject, roomId: string): void; -} diff --git a/src/api/nitro/avatar/index.ts b/src/api/nitro/avatar/index.ts new file mode 100644 index 00000000..eccf4ec5 --- /dev/null +++ b/src/api/nitro/avatar/index.ts @@ -0,0 +1 @@ +export * from './pet'; diff --git a/src/api/nitro/avatar/pet/IPetCustomPart.ts b/src/api/nitro/avatar/pet/IPetCustomPart.ts new file mode 100644 index 00000000..8d4f9684 --- /dev/null +++ b/src/api/nitro/avatar/pet/IPetCustomPart.ts @@ -0,0 +1,6 @@ +export interface IPetCustomPart +{ + layerId: number; + partId: number; + paletteId: number; +} diff --git a/src/api/nitro/avatar/pet/index.ts b/src/api/nitro/avatar/pet/index.ts new file mode 100644 index 00000000..dd896253 --- /dev/null +++ b/src/api/nitro/avatar/pet/index.ts @@ -0,0 +1 @@ +export * from './IPetCustomPart'; diff --git a/src/api/nitro/index.ts b/src/api/nitro/index.ts index 2b7ee94c..ea72f5ac 100644 --- a/src/api/nitro/index.ts +++ b/src/api/nitro/index.ts @@ -1,9 +1,13 @@ +export * from './avatar'; +export * from './avatar/pet'; export * from './camera'; export * from './communication'; export * from './enums'; -export * from './IRoomContentLoader'; export * from './localization'; export * from './room'; +export * from './room/data'; export * from './room/enums'; +export * from './room/object'; +export * from './room/utils'; export * from './session'; export * from './session/enum'; diff --git a/src/nitro/room/IGetImageListener.ts b/src/api/nitro/room/IGetImageListener.ts similarity index 72% rename from src/nitro/room/IGetImageListener.ts rename to src/api/nitro/room/IGetImageListener.ts index 4241e62f..6e400e93 100644 --- a/src/nitro/room/IGetImageListener.ts +++ b/src/api/nitro/room/IGetImageListener.ts @@ -1,4 +1,4 @@ -import { NitroRenderTexture } from '../..'; +import { NitroRenderTexture } from '../../../pixi-proxy'; export interface IGetImageListener { diff --git a/src/api/nitro/room/IImageResult.ts b/src/api/nitro/room/IImageResult.ts new file mode 100644 index 00000000..ee286f52 --- /dev/null +++ b/src/api/nitro/room/IImageResult.ts @@ -0,0 +1,9 @@ +import { RenderTexture } from '@pixi/core'; + +export interface IImageResult +{ + id: number; + data: RenderTexture; + image: HTMLImageElement; + getImage(): HTMLImageElement; +} diff --git a/src/api/nitro/room/IPetColorResult.ts b/src/api/nitro/room/IPetColorResult.ts new file mode 100644 index 00000000..f66417d5 --- /dev/null +++ b/src/api/nitro/room/IPetColorResult.ts @@ -0,0 +1,10 @@ +export interface IPetColorResult +{ + readonly primaryColor: number; + readonly secondaryColor: number; + readonly breed: number; + readonly tag: string; + readonly id: string; + readonly isMaster: boolean; + readonly layerTags: string[]; +} diff --git a/src/nitro/room/IRoomContentListener.ts b/src/api/nitro/room/IRoomContentListener.ts similarity index 100% rename from src/nitro/room/IRoomContentListener.ts rename to src/api/nitro/room/IRoomContentListener.ts diff --git a/src/api/nitro/room/IRoomContentLoader.ts b/src/api/nitro/room/IRoomContentLoader.ts new file mode 100644 index 00000000..4fe3b0b1 --- /dev/null +++ b/src/api/nitro/room/IRoomContentLoader.ts @@ -0,0 +1,34 @@ +import { Resource, Texture } from '@pixi/core'; +import { IPetColorResult, IRoomContentListener } from '.'; +import { IGraphicAssetCollection, IGraphicAssetGifCollection } from '../../asset'; +import { IEventDispatcher } from '../../common'; +import { IRoomObject } from '../../room'; +import { ISessionDataManager } from '../session'; + +export interface IRoomContentLoader +{ + dispose: () => void; + initialize(events: IEventDispatcher): void; + setSessionDataManager(sessionData: ISessionDataManager): void; + downloadAsset(type: string, events: IEventDispatcher): void; + isLoaderType(type: string): boolean; + getCollection(name: string): IGraphicAssetCollection; + getPlaceholderName(type: string): string; + getCategoryForType(type: string): number; + setRoomObjectRoomId(object: IRoomObject, roomId: string): void; + getFurnitureFloorNameForTypeId(typeId: number): string; + getFurnitureWallNameForTypeId(typeId: number, extra?: string): string; + getFurnitureFloorColorIndex(typeId: number): number; + getFurnitureWallColorIndex(typeId: number): number; + getImage(name: string): HTMLImageElement; + getAssetIconUrl(type: string, colorIndex: string): string; + addAssetToCollection(collectionName: string, assetName: string, texture: Texture, override?: boolean): boolean; + getPetNameForType(type: number): string; + downloadImage(id: number, type: string, param: string, events?: IEventDispatcher): boolean; + getRoomObjectAdUrl(type: string): string; + getPetColorResult(petIndex: number, paletteIndex: number): IPetColorResult; + getPetColorResultsForTag(petIndex: number, tagName: string): IPetColorResult[]; + setIconListener(listener: IRoomContentListener): void; + createGifCollection(collectionName: string, textures: Texture[], durations: number[]): IGraphicAssetGifCollection; + getGifCollection(name: string): IGraphicAssetGifCollection; +} diff --git a/src/nitro/room/IRoomCreator.ts b/src/api/nitro/room/IRoomCreator.ts similarity index 87% rename from src/nitro/room/IRoomCreator.ts rename to src/api/nitro/room/IRoomCreator.ts index b3302c25..acbc9906 100644 --- a/src/nitro/room/IRoomCreator.ts +++ b/src/api/nitro/room/IRoomCreator.ts @@ -1,7 +1,8 @@ -import { IObjectData, IRoomInstance, IRoomObjectController, IRoomSessionManager, ISessionDataManager, IVector3D } from '../../api'; -import { RoomMapData } from './object/RoomMapData'; -import { FurnitureStackingHeightMap } from './utils/FurnitureStackingHeightMap'; -import { LegacyWallGeometry } from './utils/LegacyWallGeometry'; +import { IRoomInstance, IRoomObjectController, IVector3D } from '../../room'; +import { IRoomSessionManager, ISessionDataManager } from '../session'; +import { IObjectData } from './data'; +import { IRoomMapData } from './object'; +import { IFurnitureStackingHeightMap, ILegacyWallGeometry } from './utils'; export interface IRoomCreator { @@ -11,12 +12,12 @@ export interface IRoomCreator updateRoomInstancePlaneThickness(roomId: number, wallThickness: number, floorThickness: number): boolean; updateRoomInstancePlaneType(roomId: number, floorType?: string, wallType?: string, landscapeType?: string, _arg_5?: boolean): boolean; removeRoomInstance(roomId: number): void; - createRoomInstance(roomId: number, roomMap: RoomMapData): void; + createRoomInstance(roomId: number, roomMap: IRoomMapData): void; setRoomSessionOwnUser(roomId: number, objectId: number): void; setRoomInstanceModelName(roomId: number, name: string): void; - getFurnitureStackingHeightMap(roomId: number): FurnitureStackingHeightMap; - setFurnitureStackingHeightMap(roomId: number, heightMap: FurnitureStackingHeightMap): void; - getLegacyWallGeometry(roomId: number): LegacyWallGeometry; + getFurnitureStackingHeightMap(roomId: number): IFurnitureStackingHeightMap; + setFurnitureStackingHeightMap(roomId: number, heightMap: IFurnitureStackingHeightMap): void; + getLegacyWallGeometry(roomId: number): ILegacyWallGeometry; getRoomObject(roomId: number, objectId: number, category: number): IRoomObjectController; getRoomObjectByIndex(roomId: number, index: number, category: number): IRoomObjectController; getRoomObjectCursor(roomId: number): IRoomObjectController; diff --git a/src/nitro/room/IRoomEngine.ts b/src/api/nitro/room/IRoomEngine.ts similarity index 87% rename from src/nitro/room/IRoomEngine.ts rename to src/api/nitro/room/IRoomEngine.ts index 5aa4ba46..42dcd019 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/api/nitro/room/IRoomEngine.ts @@ -1,14 +1,17 @@ import { RenderTexture } from '@pixi/core'; import { DisplayObject } from '@pixi/display'; import { Point, Rectangle } from '@pixi/math'; -import { INitroManager, IObjectData, IRoomGeometry, IRoomManager, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRendererFactory, IRoomRenderingCanvas, IRoomSessionManager, ISessionDataManager, IVector3D } from '../../api'; -import { PetCustomPart } from '../avatar/pets/PetCustomPart'; +import { INitroManager } from '../../common'; +import { IRoomGeometry, IRoomManager, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRendererFactory, IRoomRenderingCanvas, IVector3D } from '../../room'; +import { IPetCustomPart } from '../avatar'; +import { IRoomSessionManager, ISessionDataManager } from '../session'; +import { IObjectData } from './data'; import { IGetImageListener } from './IGetImageListener'; -import { ImageResult } from './ImageResult'; -import { RoomMapData } from './object/RoomMapData'; -import { PetColorResult } from './PetColorResult'; -import { RoomContentLoader } from './RoomContentLoader'; -import { RoomObjectEventHandler } from './RoomObjectEventHandler'; +import { IImageResult } from './IImageResult'; +import { IPetColorResult } from './IPetColorResult'; +import { IRoomContentLoader } from './IRoomContentLoader'; +import { IRoomObjectEventManager } from './IRoomObjectEventManager'; +import { IRoomMapData } from './object'; export interface IRoomEngine extends INitroManager { @@ -16,7 +19,7 @@ export interface IRoomEngine extends INitroManager onRoomEngineInitalized(flag: boolean): void; disableUpdate(flag: boolean): void; runUpdate(): void; - createRoomInstance(roomId: number, roomMap: RoomMapData): void; + createRoomInstance(roomId: number, roomMap: IRoomMapData): void; getRoomInstanceDisplay(roomId: number, id: number, width: number, height: number, scale: number): DisplayObject; setRoomInstanceRenderingCanvasScale(roomId: number, canvasId: number, scale: number, point?: Point, offsetPoint?: Point, override?: boolean, asDelta?: boolean): void; setRoomInstanceRenderingCanvasMask(roomId: number, canvasId: number, flag: boolean): void; @@ -41,11 +44,11 @@ export interface IRoomEngine extends INitroManager getRoomObjectCount(roomId: number, categoryId: number): number; getRoomObjectBoundingRectangle(roomId: number, objectId: number, category: number, canvasId: number): Rectangle; getRoomObjectScreenLocation(roomId: number, objectId: number, objectType: number, canvasId?: number): Point; - getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, objectData?: IObjectData, state?: number, frameCount?: number, posture?: string, originalId?: number): ImageResult; + getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, objectData?: IObjectData, state?: number, frameCount?: number, posture?: string, originalId?: number): IImageResult; getFurnitureFloorIconUrl(typeId: number): string; - getFurnitureFloorIcon(typeId: number, listener: IGetImageListener, extras?: string, objectData?: IObjectData): ImageResult; + getFurnitureFloorIcon(typeId: number, listener: IGetImageListener, extras?: string, objectData?: IObjectData): IImageResult; getFurnitureWallIconUrl(typeId: number, extra?: string): string; - getFurnitureWallIcon(typeId: number, listener: IGetImageListener, extras?: string): ImageResult; + getFurnitureWallIcon(typeId: number, listener: IGetImageListener, extras?: string): IImageResult; updateRoomObjectWallLocation(roomId: number, objectId: number, location: IVector3D): boolean; addRoomObjectUser(roomId: number, objectId: number, location: IVector3D, direction: IVector3D, headDirection: number, type: number, figure: string): boolean; updateRoomObjectUserLocation(roomId: number, objectId: number, location: IVector3D, targetLocation: IVector3D, canStandUp?: boolean, baseY?: number, direction?: IVector3D, headDirection?: number): boolean; @@ -60,17 +63,17 @@ export interface IRoomEngine extends INitroManager updateRoomObjectUserEffect(roomId: number, objectId: number, effectId: number, delay?: number): boolean; updateRoomObjectUserGesture(roomId: number, objectId: number, gestureId: number): boolean; updateRoomObjectUserPosture(roomId: number, objectId: number, type: string, parameter?: string): boolean; - getFurnitureFloorImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, state?: number, frameCount?: number, objectData?: IObjectData): ImageResult; - getFurnitureWallImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, state?: number, frameCount?: number): ImageResult; - getRoomObjectImage(roomId: number, objectId: number, category: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number): ImageResult; - getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly?: boolean, bgColor?: number, customParts?: PetCustomPart[], posture?: string): ImageResult; + getFurnitureFloorImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, state?: number, frameCount?: number, objectData?: IObjectData): IImageResult; + getFurnitureWallImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, state?: number, frameCount?: number): IImageResult; + getRoomObjectImage(roomId: number, objectId: number, category: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number): IImageResult; + getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly?: boolean, bgColor?: number, customParts?: IPetCustomPart[], posture?: string): IImageResult; getFurnitureFloorName(typeId: number): string; getFurnitureWallName(typeId: number, extra?: string): string; selectRoomObject(roomId: number, objectId: number, objectCategory: number): void; setSelectedAvatar(roomId: number, objectId: number): void; cancelRoomObjectInsert(): void; - getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult; - getPetColorResultsForTag(petIndex: number, tagName: string): PetColorResult[]; + getPetColorResult(petIndex: number, paletteIndex: number): IPetColorResult; + getPetColorResultsForTag(petIndex: number, tagName: string): IPetColorResult[]; cancelRoomObjectPlacement(): void; useRoomObject(objectId: number, category: number): boolean; objectInitialized(roomId: string, objectId: number, category: number): void; @@ -88,11 +91,11 @@ export interface IRoomEngine extends INitroManager sessionDataManager: ISessionDataManager; roomSessionManager: IRoomSessionManager; roomManager: IRoomManager; - objectEventHandler: RoomObjectEventHandler; + objectEventHandler: IRoomObjectEventManager; roomRendererFactory: IRoomRendererFactory; visualizationFactory: IRoomObjectVisualizationFactory; logicFactory: IRoomObjectLogicFactory; - roomContentLoader: RoomContentLoader; + roomContentLoader: IRoomContentLoader; activeRoomId: number; ready: boolean; disposed: boolean; diff --git a/src/nitro/room/IRoomEngineServices.ts b/src/api/nitro/room/IRoomEngineServices.ts similarity index 74% rename from src/nitro/room/IRoomEngineServices.ts rename to src/api/nitro/room/IRoomEngineServices.ts index a2a06e52..7b8d363a 100644 --- a/src/nitro/room/IRoomEngineServices.ts +++ b/src/api/nitro/room/IRoomEngineServices.ts @@ -1,8 +1,10 @@ -import { IConnection, IEventDispatcher, IObjectData, IRoomInstance, IRoomObjectController, IRoomRenderingCanvas, IRoomSessionManager, ISessionDataManager, IVector3D } from '../../api'; -import { FurnitureStackingHeightMap } from './utils/FurnitureStackingHeightMap'; -import { LegacyWallGeometry } from './utils/LegacyWallGeometry'; -import { SelectedRoomObjectData } from './utils/SelectedRoomObjectData'; -import { TileObjectMap } from './utils/TileObjectMap'; +import { IEventDispatcher } from '../../common'; +import { IConnection } from '../../communication'; +import { IRoomInstance, IRoomObjectController, IRoomRenderingCanvas, IVector3D } from '../../room'; +import { IRoomSessionManager, ISessionDataManager } from '../session'; +import { IObjectData } from './data'; +import { ISelectedRoomObjectData } from './ISelectedRoomObjectData'; +import { IFurnitureStackingHeightMap, ILegacyWallGeometry, ITileObjectMap } from './utils'; export interface IRoomEngineServices { @@ -10,12 +12,12 @@ export interface IRoomEngineServices getActiveRoomInstanceRenderingCanvas(): IRoomRenderingCanvas; addRoomInstanceFloorHole(roomId: number, objectId: number): void; removeRoomInstanceFloorHole(roomId: number, objectId: number): void; - getSelectedRoomObjectData(roomId: number): SelectedRoomObjectData; - setSelectedRoomObjectData(roomId: number, data: SelectedRoomObjectData): void; - getPlacedRoomObjectData(roomId: number): SelectedRoomObjectData; - setPlacedRoomObjectData(roomId: number, data: SelectedRoomObjectData): void; - getLegacyWallGeometry(roomId: number): LegacyWallGeometry; - getFurnitureStackingHeightMap(roomId: number): FurnitureStackingHeightMap; + getSelectedRoomObjectData(roomId: number): ISelectedRoomObjectData; + setSelectedRoomObjectData(roomId: number, data: ISelectedRoomObjectData): void; + getPlacedRoomObjectData(roomId: number): ISelectedRoomObjectData; + setPlacedRoomObjectData(roomId: number, data: ISelectedRoomObjectData): void; + getLegacyWallGeometry(roomId: number): ILegacyWallGeometry; + getFurnitureStackingHeightMap(roomId: number): IFurnitureStackingHeightMap; getRoomObject(roomId: number, objectId: number, category: number): IRoomObjectController; getRoomObjectByIndex(roomId: number, index: number, category: number): IRoomObjectController; getRoomObjectCategoryForType(type: string): number; @@ -34,7 +36,7 @@ export interface IRoomEngineServices setObjectMoverIconSpriteVisible(k: boolean): void; updateMousePointer(type: string, objectId: number, objectType: string): void; removeObjectMoverIconSprite(): void; - getRoomTileObjectMap(k: number): TileObjectMap; + getRoomTileObjectMap(k: number): ITileObjectMap; isPlayingGame(): boolean; connection: IConnection; sessionDataManager: ISessionDataManager; diff --git a/src/api/nitro/room/IRoomObjectEventManager.ts b/src/api/nitro/room/IRoomObjectEventManager.ts new file mode 100644 index 00000000..4f0cec3a --- /dev/null +++ b/src/api/nitro/room/IRoomObjectEventManager.ts @@ -0,0 +1,6 @@ +import { IRoomObjectController } from '../../room'; + +export interface IRoomObjectEventManager +{ + getValidRoomObjectDirection(k: IRoomObjectController, _arg_2: boolean): number; +} diff --git a/src/nitro/room/ISelectedRoomObjectData.ts b/src/api/nitro/room/ISelectedRoomObjectData.ts similarity index 62% rename from src/nitro/room/ISelectedRoomObjectData.ts rename to src/api/nitro/room/ISelectedRoomObjectData.ts index f2338bb4..f4b4a6cb 100644 --- a/src/nitro/room/ISelectedRoomObjectData.ts +++ b/src/api/nitro/room/ISelectedRoomObjectData.ts @@ -1,14 +1,18 @@ -import { IObjectData } from '../../api'; +import { IVector3D } from '../../room'; +import { IObjectData } from './data'; export interface ISelectedRoomObjectData { id: number; category: number; operation: string; + loc: IVector3D; + dir: IVector3D; typeId: number; instanceData: string; stuffData: IObjectData; state: number; animFrame: number; posture: string; + dispose: () => void; } diff --git a/src/api/nitro/room/index.ts b/src/api/nitro/room/index.ts index c86d6656..71e9d5b0 100644 --- a/src/api/nitro/room/index.ts +++ b/src/api/nitro/room/index.ts @@ -1,2 +1,14 @@ export * from './data'; export * from './enums'; +export * from './IGetImageListener'; +export * from './IImageResult'; +export * from './IPetColorResult'; +export * from './IRoomContentListener'; +export * from './IRoomContentLoader'; +export * from './IRoomCreator'; +export * from './IRoomEngine'; +export * from './IRoomEngineServices'; +export * from './IRoomObjectEventManager'; +export * from './ISelectedRoomObjectData'; +export * from './object'; +export * from './utils'; diff --git a/src/api/nitro/room/object/IRoomMapData.ts b/src/api/nitro/room/object/IRoomMapData.ts new file mode 100644 index 00000000..a54a7c38 --- /dev/null +++ b/src/api/nitro/room/object/IRoomMapData.ts @@ -0,0 +1,14 @@ +export interface IRoomMapData +{ + width: number; + height: number; + wallHeight: number; + fixedWallsHeight: number; + tileMap: { height: number }[][]; + holeMap: { id: number, x: number, y: number, width: number, height: number }[]; + doors: { x: number, y: number, z: number, dir: number }[]; + dimensions: { minX: number, maxX: number, minY: number, maxY: number }; + restrictsDragging: boolean; + restrictsScaling: boolean; + restrictedScale: number; +} diff --git a/src/api/nitro/room/object/index.ts b/src/api/nitro/room/object/index.ts new file mode 100644 index 00000000..71d089c6 --- /dev/null +++ b/src/api/nitro/room/object/index.ts @@ -0,0 +1 @@ +export * from './IRoomMapData'; diff --git a/src/api/nitro/room/utils/IFurnitureStackingHeightMap.ts b/src/api/nitro/room/utils/IFurnitureStackingHeightMap.ts new file mode 100644 index 00000000..5427932b --- /dev/null +++ b/src/api/nitro/room/utils/IFurnitureStackingHeightMap.ts @@ -0,0 +1,11 @@ +export interface IFurnitureStackingHeightMap +{ + dispose: () => void; + getTileHeight(x: number, y: number): number; + setTileHeight(x: number, y: number, height: number): void; + setStackingBlocked(x: number, y: number, isNotStackable: boolean): void; + setIsRoomTile(x: number, y: number, isRoomTile: boolean): void; + validateLocation(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: boolean, _arg_10?: number): boolean; + readonly width: number; + readonly height: number; +} diff --git a/src/api/nitro/room/utils/ILegacyWallGeometry.ts b/src/api/nitro/room/utils/ILegacyWallGeometry.ts new file mode 100644 index 00000000..1ce25a9b --- /dev/null +++ b/src/api/nitro/room/utils/ILegacyWallGeometry.ts @@ -0,0 +1,18 @@ +import { IVector3D } from '../../../room'; + +export interface ILegacyWallGeometry +{ + dispose: () => void; + readonly disposed: boolean; + scale: number; + initialize(width: number, height: number, floorHeight: number): void; + setHeight(x: number, y: number, height: number): boolean; + getHeight(x: number, y: number): number; + getLocation(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: string): IVector3D; + getLocationOldFormat(k: number, _arg_2: number, _arg_3: string): IVector3D; + getOldLocation(k: IVector3D, _arg_2: number): [number, number, number, number, string]; + getOldLocationString(k: IVector3D, _arg_2: number): string; + getDirection(k: string): number; + getFloorAltitude(k: number, _arg_2: number): number; + isRoomTile(k: number, _arg_2: number): boolean; +} diff --git a/src/api/nitro/room/utils/ITileObjectMap.ts b/src/api/nitro/room/utils/ITileObjectMap.ts new file mode 100644 index 00000000..b7fda053 --- /dev/null +++ b/src/api/nitro/room/utils/ITileObjectMap.ts @@ -0,0 +1,11 @@ +import { IRoomObject } from '../../../room'; + +export interface ITileObjectMap +{ + clear(): void; + populate(k: IRoomObject[]): void; + dispose(): void; + getObjectIntTile(k: number, _arg_2: number): IRoomObject; + setObjectInTile(k: number, _arg_2: number, _arg_3: IRoomObject): void; + addRoomObject(k: IRoomObject): void; +} diff --git a/src/api/nitro/room/utils/index.ts b/src/api/nitro/room/utils/index.ts new file mode 100644 index 00000000..b80a2402 --- /dev/null +++ b/src/api/nitro/room/utils/index.ts @@ -0,0 +1,3 @@ +export * from './IFurnitureStackingHeightMap'; +export * from './ILegacyWallGeometry'; +export * from './ITileObjectMap'; diff --git a/src/nitro/INitro.ts b/src/nitro/INitro.ts index 6c238fcc..04fbc705 100644 --- a/src/nitro/INitro.ts +++ b/src/nitro/INitro.ts @@ -1,8 +1,7 @@ import { Application } from '@pixi/app'; import { Ticker } from '@pixi/ticker'; -import { IEventDispatcher, ILinkEventTracker, INitroCommunicationManager, INitroCore, INitroLocalizationManager, IRoomCameraWidgetManager, IRoomManager, IRoomSessionManager, ISessionDataManager, IWorkerEventTracker } from '../api'; +import { IEventDispatcher, ILinkEventTracker, INitroCommunicationManager, INitroCore, INitroLocalizationManager, IRoomCameraWidgetManager, IRoomEngine, IRoomManager, IRoomSessionManager, ISessionDataManager, IWorkerEventTracker } from '../api'; import { IAvatarRenderManager } from './avatar/IAvatarRenderManager'; -import { IRoomEngine } from './room/IRoomEngine'; import { ISoundManager } from './sound/ISoundManager'; export interface INitro diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index 9dde5426..16b1dbf1 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -2,7 +2,7 @@ import { Application, IApplicationOptions } from '@pixi/app'; import { SCALE_MODES } from '@pixi/constants'; import { settings } from '@pixi/settings'; import { Ticker } from '@pixi/ticker'; -import { IEventDispatcher, ILinkEventTracker, INitroCommunicationManager, INitroCore, INitroLocalizationManager, IRoomCameraWidgetManager, IRoomManager, IRoomSessionManager, ISessionDataManager, IWorkerEventTracker } from '../api'; +import { IEventDispatcher, ILinkEventTracker, INitroCommunicationManager, INitroCore, INitroLocalizationManager, IRoomCameraWidgetManager, IRoomEngine, IRoomManager, IRoomSessionManager, ISessionDataManager, IWorkerEventTracker } from '../api'; import { ConfigurationEvent, EventDispatcher, NitroCore, NitroEvent } from '../core'; import { PixiApplicationProxy } from '../pixi-proxy'; import { RoomManager } from '../room/RoomManager'; @@ -16,7 +16,6 @@ import { INitro } from './INitro'; import { NitroLocalizationManager } from './localization/NitroLocalizationManager'; import './Plugins'; import { RoomEngineEvent } from './room/events/RoomEngineEvent'; -import { IRoomEngine } from './room/IRoomEngine'; import { RoomEngine } from './room/RoomEngine'; import { RoomSessionManager } from './session/RoomSessionManager'; import { SessionDataManager } from './session/SessionDataManager'; diff --git a/src/nitro/avatar/pets/PetCustomPart.ts b/src/nitro/avatar/pets/PetCustomPart.ts index ade87f60..7c1f8029 100644 --- a/src/nitro/avatar/pets/PetCustomPart.ts +++ b/src/nitro/avatar/pets/PetCustomPart.ts @@ -1,4 +1,6 @@ -export class PetCustomPart +import { IPetCustomPart } from '../../../api'; + +export class PetCustomPart implements IPetCustomPart { private _layerId: number; private _partId: number; @@ -40,4 +42,4 @@ export class PetCustomPart { this._paletteId = paletteId; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/pets/PetFigureData.ts b/src/nitro/avatar/pets/PetFigureData.ts index 66b4b9d3..39763b01 100644 --- a/src/nitro/avatar/pets/PetFigureData.ts +++ b/src/nitro/avatar/pets/PetFigureData.ts @@ -1,3 +1,4 @@ +import { IPetCustomPart } from '../../../api'; import { PetCustomPart } from './PetCustomPart'; export class PetFigureData @@ -7,7 +8,7 @@ export class PetFigureData private _color: number; private _headOnly: boolean; - private _customParts: PetCustomPart[]; + private _customParts: IPetCustomPart[]; private _customLayerIds: number[]; private _customPartIds: number[]; private _customPaletteIds: number[]; @@ -28,7 +29,7 @@ export class PetFigureData let i = 0; - while(i < this._customLayerIds.length) + while (i < this._customLayerIds.length) { this._customParts.push(new PetCustomPart(this._customLayerIds[i], this._customPartIds[i], this._customPaletteIds[i])); @@ -66,18 +67,18 @@ export class PetFigureData return this._customPaletteIds; } - public get customParts(): PetCustomPart[] + public get customParts(): IPetCustomPart[] { return this._customParts; } - public getCustomPart(k: number): PetCustomPart + public getCustomPart(k: number): IPetCustomPart { - if(this._customParts) + if (this._customParts) { - for(const _local_2 of this._customParts) + for (const _local_2 of this._customParts) { - if(_local_2.layerId === k) return _local_2; + if (_local_2.layerId === k) return _local_2; } } @@ -100,7 +101,7 @@ export class PetFigureData figure = (figure + (' ' + this.customParts.length)); - for(const _local_2 of this.customParts) + for (const _local_2 of this.customParts) { figure = (figure + (((((' ' + _local_2.layerId) + ' ') + _local_2.partId) + ' ') + _local_2.paletteId)); } @@ -112,13 +113,13 @@ export class PetFigureData { let _local_2: string[] = []; - if(k) + if (k) { const _local_3 = k.split(' '); const _local_4 = ((this._headOnly) ? 1 : 0); const _local_5 = (4 + _local_4); - if(_local_3.length > _local_5) + if (_local_3.length > _local_5) { const _local_6 = (3 + _local_4); const _local_7 = parseInt(_local_3[_local_6]); @@ -136,7 +137,7 @@ export class PetFigureData let i = 0; - while(i < data.length) + while (i < data.length) { layerIds.push(parseInt(data[(i + 0)])); @@ -152,7 +153,7 @@ export class PetFigureData let i = 0; - while(i < data.length) + while (i < data.length) { partIds.push(parseInt(data[(i + 1)])); @@ -168,7 +169,7 @@ export class PetFigureData let i = 0; - while(i < data.length) + while (i < data.length) { paletteIds.push(parseInt(data[(i + 2)])); @@ -180,11 +181,11 @@ export class PetFigureData private getTypeId(data: string): number { - if(data) + if (data) { const parts = data.split(' '); - if(parts.length >= 1) return parseInt(parts[0]); + if (parts.length >= 1) return parseInt(parts[0]); } return 0; @@ -192,11 +193,11 @@ export class PetFigureData private getPaletteId(data: string): number { - if(data) + if (data) { const parts = data.split(' '); - if(parts.length >= 2) return parseInt(parts[1]); + if (parts.length >= 2) return parseInt(parts[1]); } return 0; @@ -204,11 +205,11 @@ export class PetFigureData private getColor(data: string): number { - if(data) + if (data) { const parts = data.split(' '); - if(parts.length >= 3) return parseInt(parts[2], 16); + if (parts.length >= 3) return parseInt(parts[2], 16); } return 0xFFFFFF; @@ -216,11 +217,11 @@ export class PetFigureData private getHeadOnly(data: string): boolean { - if(data) + if (data) { const parts = data.split(' '); - if(parts.length >= 4) return parts[3] === 'head'; + if (parts.length >= 4) return parts[3] === 'head'; } return false; diff --git a/src/nitro/room/ImageResult.ts b/src/nitro/room/ImageResult.ts index 55666ac5..0ebde09d 100644 --- a/src/nitro/room/ImageResult.ts +++ b/src/nitro/room/ImageResult.ts @@ -1,7 +1,8 @@ import { RenderTexture } from '@pixi/core'; +import { IImageResult } from '../../api'; import { TextureUtils } from '../../pixi-proxy'; -export class ImageResult +export class ImageResult implements IImageResult { public id: number = 0; public data: RenderTexture = null; diff --git a/src/nitro/room/PetColorResult.ts b/src/nitro/room/PetColorResult.ts index f15e473d..7cb64d84 100644 --- a/src/nitro/room/PetColorResult.ts +++ b/src/nitro/room/PetColorResult.ts @@ -1,4 +1,6 @@ -export class PetColorResult +import { IPetColorResult } from '../../api'; + +export class PetColorResult implements IPetColorResult { private static COLOR_TAGS: string[] = ['Null', 'Black', 'White', 'Grey', 'Red', 'Orange', 'Pink', 'Green', 'Lime', 'Blue', 'Light-Blue', 'Dark-Blue', 'Yellow', 'Brown', 'Dark-Brown', 'Beige', 'Cyan', 'Purple', 'Gold']; diff --git a/src/nitro/room/RoomContentLoader.ts b/src/nitro/room/RoomContentLoader.ts index 1f484fa3..5fbcca71 100644 --- a/src/nitro/room/RoomContentLoader.ts +++ b/src/nitro/room/RoomContentLoader.ts @@ -1,11 +1,10 @@ import { BaseTexture, Resource, Texture } from '@pixi/core'; import { Loader, LoaderResource } from '@pixi/loaders'; import { Spritesheet } from '@pixi/spritesheet'; -import { FurnitureType, IAssetData, IEventDispatcher, IFurnitureData, IFurnitureDataListener, IGraphicAssetCollection, INitroLogger, IRoomContentLoader, IRoomObject, ISessionDataManager } from '../../api'; +import { FurnitureType, IAssetData, IEventDispatcher, IFurnitureData, IFurnitureDataListener, IGraphicAssetCollection, IGraphicAssetGifCollection, INitroLogger, IPetColorResult, IRoomContentListener, IRoomContentLoader, IRoomObject, ISessionDataManager } from '../../api'; import { GraphicAssetCollection, GraphicAssetGifCollection, NitroBundle, NitroEvent, NitroLogger } from '../../core'; import { RoomContentLoadedEvent } from '../../room/events/RoomContentLoadedEvent'; import { Nitro } from '../Nitro'; -import { IRoomContentListener } from './IRoomContentListener'; import { RoomObjectCategory } from './object/RoomObjectCategory'; import { RoomObjectUserType } from './object/RoomObjectUserType'; import { RoomObjectVariable } from './object/RoomObjectVariable'; @@ -44,7 +43,7 @@ export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLo private _wallItemTypeIds: Map; private _furniRevisions: Map; private _pets: { [index: string]: number }; - private _petColors: Map>; + private _petColors: Map>; private _objectAliases: Map; private _objectOriginalNames: Map; @@ -255,7 +254,7 @@ export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLo return value; } - public getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult + public getPetColorResult(petIndex: number, paletteIndex: number): IPetColorResult { const colorResults = this._petColors.get(petIndex); @@ -264,10 +263,10 @@ export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLo return colorResults.get(paletteIndex); } - public getPetColorResultsForTag(petIndex: number, tagName: string): PetColorResult[] + public getPetColorResultsForTag(petIndex: number, tagName: string): IPetColorResult[] { const colorResults = this._petColors.get(petIndex); - const results: PetColorResult[] = []; + const results: IPetColorResult[] = []; if (colorResults) { @@ -303,7 +302,7 @@ export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLo return existing; } - public getGifCollection(name: string): GraphicAssetGifCollection + public getGifCollection(name: string): IGraphicAssetGifCollection { if (!name) return null; @@ -358,7 +357,7 @@ export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLo if (petIndex !== undefined) { const keys = collection.getPaletteNames(); - const palettes: Map = new Map(); + const palettes: Map = new Map(); for (const key of keys) { diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index b980bcc0..32fc1530 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -1,11 +1,11 @@ import { RenderTexture, Resource, Texture } from '@pixi/core'; import { Container, DisplayObject } from '@pixi/display'; import { Matrix, Point, Rectangle } from '@pixi/math'; -import { IConnection, IDisposable, IMessageComposer, INitroCommunicationManager, IObjectData, IRoomGeometry, IRoomInstance, IRoomManager, IRoomManagerListener, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRenderer, IRoomRendererFactory, IRoomRenderingCanvas, IRoomSessionManager, ISessionDataManager, IUpdateReceiver, IVector3D, RoomControllerLevel, ToolbarIconEnum } from '../../api'; +import { IConnection, IDisposable, IFurnitureStackingHeightMap, IImageResult, ILegacyWallGeometry, IMessageComposer, INitroCommunicationManager, IObjectData, IPetColorResult, IPetCustomPart, IRoomContentListener, IRoomContentLoader, IRoomCreator, IRoomEngine, IRoomEngineServices, IRoomGeometry, IRoomInstance, IRoomManager, IRoomManagerListener, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRenderer, IRoomRendererFactory, IRoomRenderingCanvas, IRoomSessionManager, ISelectedRoomObjectData, ISessionDataManager, ITileObjectMap, IUpdateReceiver, IVector3D, RoomControllerLevel, ToolbarIconEnum } from '../../api'; +import { IGetImageListener } from '../../api/nitro/room/IGetImageListener'; import { NitroEvent, NitroManager } from '../../core'; import { NitroSprite, TextureUtils } from '../../pixi-proxy'; import { NumberBank, RoomEnterEffect, RoomGeometry, RoomInstance, RoomObjectEvent, RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomRendererFactory, Vector3d } from '../../room'; -import { PetCustomPart } from '../avatar/pets/PetCustomPart'; import { PetFigureData } from '../avatar/pets/PetFigureData'; import { RenderRoomMessageComposer, RenderRoomThumbnailMessageComposer } from '../communication'; import { NitroToolbarAnimateIconEvent } from '../events/NitroToolbarAnimateIconEvent'; @@ -20,12 +20,7 @@ import { RoomEngineEvent } from './events/RoomEngineEvent'; import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent'; import { RoomObjectFurnitureActionEvent } from './events/RoomObjectFurnitureActionEvent'; import { RoomToObjectOwnAvatarMoveEvent } from './events/RoomToObjectOwnAvatarMoveEvent'; -import { IGetImageListener } from './IGetImageListener'; import { ImageResult } from './ImageResult'; -import { IRoomContentListener } from './IRoomContentListener'; -import { IRoomCreator } from './IRoomCreator'; -import { IRoomEngine } from './IRoomEngine'; -import { IRoomEngineServices } from './IRoomEngineServices'; import { ObjectAvatarCarryObjectUpdateMessage } from './messages/ObjectAvatarCarryObjectUpdateMessage'; import { ObjectAvatarChatUpdateMessage } from './messages/ObjectAvatarChatUpdateMessage'; import { ObjectAvatarDanceUpdateMessage } from './messages/ObjectAvatarDanceUpdateMessage'; @@ -68,22 +63,17 @@ import { RoomObjectCategory } from './object/RoomObjectCategory'; import { RoomObjectUserType } from './object/RoomObjectUserType'; import { RoomObjectVariable } from './object/RoomObjectVariable'; import { RoomObjectVisualizationFactory } from './object/RoomObjectVisualizationFactory'; -import { PetColorResult } from './PetColorResult'; import { RoomContentLoader } from './RoomContentLoader'; import { RoomMessageHandler } from './RoomMessageHandler'; import { RoomObjectEventHandler } from './RoomObjectEventHandler'; import { RoomObjectLogicFactory } from './RoomObjectLogicFactory'; import { RoomVariableEnum } from './RoomVariableEnum'; -import { FurnitureStackingHeightMap } from './utils/FurnitureStackingHeightMap'; -import { LegacyWallGeometry } from './utils/LegacyWallGeometry'; import { RoomCamera } from './utils/RoomCamera'; import { RoomData } from './utils/RoomData'; import { RoomFurnitureData } from './utils/RoomFurnitureData'; import { RoomInstanceData } from './utils/RoomInstanceData'; import { RoomObjectBadgeImageAssetListener } from './utils/RoomObjectBadgeImageAssetListener'; -import { SelectedRoomObjectData } from './utils/SelectedRoomObjectData'; import { SpriteDataCollector } from './utils/SpriteDataCollector'; -import { TileObjectMap } from './utils/TileObjectMap'; export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreator, IRoomEngineServices, IRoomManagerListener, IRoomContentListener, IUpdateReceiver, IDisposable { @@ -110,7 +100,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato private _roomSessionManager: IRoomSessionManager; private _roomObjectEventHandler: RoomObjectEventHandler; private _roomMessageHandler: RoomMessageHandler; - private _roomContentLoader: RoomContentLoader; + private _roomContentLoader: IRoomContentLoader; private _ready: boolean; private _roomContentLoaderReady: boolean; private _imageObjectIdBank: NumberBank; @@ -1573,7 +1563,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato instanceData.setModelName(name); } - public getRoomTileObjectMap(k: number): TileObjectMap + public getRoomTileObjectMap(k: number): ITileObjectMap { const roomInstance = this.getRoomInstanceData(k); @@ -1596,7 +1586,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return instanceData.roomCamera; } - public getSelectedRoomObjectData(roomId: number): SelectedRoomObjectData + public getSelectedRoomObjectData(roomId: number): ISelectedRoomObjectData { const instanceData = this.getRoomInstanceData(roomId); @@ -1605,7 +1595,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return instanceData.selectedObject; } - public setSelectedRoomObjectData(roomId: number, data: SelectedRoomObjectData): void + public setSelectedRoomObjectData(roomId: number, data: ISelectedRoomObjectData): void { const instanceData = this.getRoomInstanceData(roomId); @@ -1616,7 +1606,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if (data) instanceData.setPlacedObject(null); } - public getPlacedRoomObjectData(roomId: number): SelectedRoomObjectData + public getPlacedRoomObjectData(roomId: number): ISelectedRoomObjectData { const instanceData = this.getRoomInstanceData(roomId); @@ -1625,7 +1615,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return instanceData.placedObject; } - public setPlacedRoomObjectData(roomId: number, data: SelectedRoomObjectData): void + public setPlacedRoomObjectData(roomId: number, data: ISelectedRoomObjectData): void { const instanceData = this.getRoomInstanceData(roomId); @@ -1641,7 +1631,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomObjectEventHandler.cancelRoomObjectPlacement(this._activeRoomId); } - public getFurnitureStackingHeightMap(roomId: number): FurnitureStackingHeightMap + public getFurnitureStackingHeightMap(roomId: number): IFurnitureStackingHeightMap { const instanceData = this.getRoomInstanceData(roomId); @@ -1650,7 +1640,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return instanceData.furnitureStackingHeightMap; } - public setFurnitureStackingHeightMap(roomId: number, heightMap: FurnitureStackingHeightMap): void + public setFurnitureStackingHeightMap(roomId: number, heightMap: IFurnitureStackingHeightMap): void { const instanceData = this.getRoomInstanceData(roomId); @@ -1659,7 +1649,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato instanceData.setFurnitureStackingHeightMap(heightMap); } - public getLegacyWallGeometry(roomId: number): LegacyWallGeometry + public getLegacyWallGeometry(roomId: number): ILegacyWallGeometry { const instanceData = this.getRoomInstanceData(roomId); @@ -2779,7 +2769,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { let type: string = null; let colorIndex = 0; - let imageResult: ImageResult = null; + let imageResult: IImageResult = null; const scale = 1; if (_arg_3) @@ -2845,7 +2835,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - public getRoomObjectImage(roomId: number, objectId: number, category: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0): ImageResult + public getRoomObjectImage(roomId: number, objectId: number, category: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0): IImageResult { if (!this._roomManager) return null; @@ -2911,7 +2901,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return null; } - public getFurnitureFloorIcon(typeId: number, listener: IGetImageListener, extras: string = null, objectData: IObjectData = null): ImageResult + public getFurnitureFloorIcon(typeId: number, listener: IGetImageListener, extras: string = null, objectData: IObjectData = null): IImageResult { return this.getFurnitureFloorImage(typeId, new Vector3d(), 1, listener, 0, extras, -1, -1, objectData); } @@ -2932,12 +2922,12 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return null; } - public getFurnitureWallIcon(typeId: number, listener: IGetImageListener, extras: string = null): ImageResult + public getFurnitureWallIcon(typeId: number, listener: IGetImageListener, extras: string = null): IImageResult { return this.getFurnitureWallImage(typeId, new Vector3d(), 1, listener, 0, extras); } - public getFurnitureFloorImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, state: number = -1, frameCount: number = -1, objectData: IObjectData = null): ImageResult + public getFurnitureFloorImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, state: number = -1, frameCount: number = -1, objectData: IObjectData = null): IImageResult { let type: string = null; let color = ''; @@ -2956,7 +2946,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return this.getGenericRoomObjectImage(type, color, direction, scale, listener, bgColor, extras, objectData, state, frameCount); } - public getFurnitureWallImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, state: number = -1, frameCount: number = -1): ImageResult + public getFurnitureWallImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, state: number = -1, frameCount: number = -1): IImageResult { let type: string = null; let color = ''; @@ -2975,7 +2965,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return this.getGenericRoomObjectImage(type, color, direction, scale, listener, bgColor, extras, null, state, frameCount); } - public getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly: boolean = false, bgColor: number = 0, customParts: PetCustomPart[] = null, posture: string = null): ImageResult + public getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly: boolean = false, bgColor: number = 0, customParts: IPetCustomPart[] = null, posture: string = null): IImageResult { let type: string = null; let value = ((((typeId + ' ') + paletteId) + ' ') + color.toString(16)); @@ -2997,7 +2987,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return this.getGenericRoomObjectImage(type, value, direction, scale, listener, bgColor, null, null, -1, -1, posture); } - public getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, objectData: IObjectData = null, state: number = -1, frameCount: number = -1, posture: string = null, originalId: number = -1): ImageResult + public getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, objectData: IObjectData = null, state: number = -1, frameCount: number = -1, posture: string = null, originalId: number = -1): IImageResult { if (!this._roomManager) return null; @@ -3137,7 +3127,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return imageResult; } - public getGenericRoomObjectThumbnail(type: string, param: string, listener: IGetImageListener, extraData: string = null, stuffData: IObjectData = null): ImageResult + public getGenericRoomObjectThumbnail(type: string, param: string, listener: IGetImageListener, extraData: string = null, stuffData: IObjectData = null): IImageResult { if (!this._roomManager) return null; @@ -3564,14 +3554,14 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return (this._roomContentLoader.getCollection(name) !== null); } - public getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult + public getPetColorResult(petIndex: number, paletteIndex: number): IPetColorResult { if (!this._roomContentLoader) return null; return this._roomContentLoader.getPetColorResult(petIndex, paletteIndex); } - public getPetColorResultsForTag(petIndex: number, tagName: string): PetColorResult[] + public getPetColorResultsForTag(petIndex: number, tagName: string): IPetColorResult[] { if (!this._roomContentLoader) return null; @@ -3650,7 +3640,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return this._ready; } - public get roomContentLoader(): RoomContentLoader + public get roomContentLoader(): IRoomContentLoader { return this._roomContentLoader; } diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index 2818760b..982b7320 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -1,4 +1,4 @@ -import { IConnection, IVector3D } from '../../api'; +import { IConnection, IRoomCreator, IVector3D } from '../../api'; import { Disposable } from '../../core'; import { Vector3d } from '../../room'; import { AvatarGuideStatus } from '../avatar/enum/AvatarGuideStatus'; @@ -52,7 +52,6 @@ import { FurnitureFloorDataParser } from '../communication/messages/parser/room/ import { FurnitureWallDataParser } from '../communication/messages/parser/room/furniture/wall/FurnitureWallDataParser'; import { RoomEntryTileMessageParser } from '../communication/messages/parser/room/mapping/RoomEntryTileMessageParser'; import { RoomObjectType } from '../room/object/RoomObjectType'; -import { IRoomCreator } from './IRoomCreator'; import { LegacyDataType } from './object/data/type/LegacyDataType'; import { RoomObjectUserType } from './object/RoomObjectUserType'; import { RoomObjectVariable } from './object/RoomObjectVariable'; diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index cee4f129..edba6c8e 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -1,4 +1,4 @@ -import { IObjectData, IRoomCanvasMouseListener, IRoomGeometry, IRoomObject, IRoomObjectController, IVector3D, RoomObjectPlacementSource } from '../../api'; +import { IFurnitureStackingHeightMap, ILegacyWallGeometry, IObjectData, IRoomCanvasMouseListener, IRoomEngineServices, IRoomGeometry, IRoomObject, IRoomObjectController, IRoomObjectEventManager, ISelectedRoomObjectData, IVector3D, RoomObjectPlacementSource } from '../../api'; import { Disposable, NitroLogger } from '../../core'; import { RoomEnterEffect, RoomId, Vector3d } from '../../room'; import { RoomObjectEvent } from '../../room/events/RoomObjectEvent'; @@ -49,7 +49,6 @@ import { RoomObjectStateChangedEvent } from './events/RoomObjectStateChangedEven import { RoomObjectTileMouseEvent } from './events/RoomObjectTileMouseEvent'; import { RoomObjectWallMouseEvent } from './events/RoomObjectWallMouseEvent'; import { RoomObjectWidgetRequestEvent } from './events/RoomObjectWidgetRequestEvent'; -import { IRoomEngineServices } from './IRoomEngineServices'; import { ObjectAvatarSelectedMessage } from './messages/ObjectAvatarSelectedMessage'; import { ObjectDataUpdateMessage } from './messages/ObjectDataUpdateMessage'; import { ObjectSelectedMessage } from './messages/ObjectSelectedMessage'; @@ -60,11 +59,9 @@ import { RoomObjectOperationType } from './object/RoomObjectOperationType'; import { RoomObjectType } from './object/RoomObjectType'; import { RoomObjectUserType } from './object/RoomObjectUserType'; import { RoomObjectVariable } from './object/RoomObjectVariable'; -import { FurnitureStackingHeightMap } from './utils/FurnitureStackingHeightMap'; -import { LegacyWallGeometry } from './utils/LegacyWallGeometry'; import { SelectedRoomObjectData } from './utils/SelectedRoomObjectData'; -export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMouseListener +export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMouseListener, IRoomObjectEventManager { private _roomEngine: IRoomEngineServices; @@ -1299,7 +1296,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - private handleFurnitureMove(roomObject: IRoomObjectController, selectedObjectData: SelectedRoomObjectData, x: number, y: number, stackingHeightMap: FurnitureStackingHeightMap): boolean + private handleFurnitureMove(roomObject: IRoomObjectController, selectedObjectData: ISelectedRoomObjectData, x: number, y: number, stackingHeightMap: IFurnitureStackingHeightMap): boolean { if (!roomObject || !selectedObjectData) return false; @@ -1338,7 +1335,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - private handleWallItemMove(k: IRoomObjectController, _arg_2: SelectedRoomObjectData, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: IVector3D, _arg_6: number, _arg_7: number, _arg_8: number): boolean + private handleWallItemMove(k: IRoomObjectController, _arg_2: ISelectedRoomObjectData, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: IVector3D, _arg_6: number, _arg_7: number, _arg_8: number): boolean { if (!k || !_arg_2) return false; @@ -1353,7 +1350,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - private validateFurnitureLocation(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: FurnitureStackingHeightMap): Vector3d + private validateFurnitureLocation(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: IFurnitureStackingHeightMap): Vector3d { if (!k || !k.model || !_arg_2) return null; @@ -1423,7 +1420,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return null; } - private validateWallItemLocation(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: number, _arg_6: number, _arg_7: SelectedRoomObjectData): Vector3d + private validateWallItemLocation(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: number, _arg_6: number, _arg_7: ISelectedRoomObjectData): Vector3d { if ((((((k == null) || (k.model == null)) || (_arg_2 == null)) || (_arg_3 == null)) || (_arg_4 == null)) || (_arg_7 == null)) return null; @@ -1990,7 +1987,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return direction; } - private isValidLocation(object: IRoomObject, goalDirection: IVector3D, stackingHeightMap: FurnitureStackingHeightMap): boolean + private isValidLocation(object: IRoomObject, goalDirection: IVector3D, stackingHeightMap: IFurnitureStackingHeightMap): boolean { if (!object || !object.model || !goalDirection) return false; @@ -2199,7 +2196,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - private getSelectedRoomObjectData(roomId: number): SelectedRoomObjectData + private getSelectedRoomObjectData(roomId: number): ISelectedRoomObjectData { if (!this._roomEngine) return null; @@ -2245,7 +2242,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.setSelectedRoomObjectData(roomId, selectedData); } - private handleUserPlace(roomObject: IRoomObjectController, x: number, y: number, wallGeometry: LegacyWallGeometry): boolean + private handleUserPlace(roomObject: IRoomObjectController, x: number, y: number, wallGeometry: ILegacyWallGeometry): boolean { if (!wallGeometry.isRoomTile(x, y)) return false; diff --git a/src/nitro/room/index.ts b/src/nitro/room/index.ts index 1cb498f6..bbfec3e8 100644 --- a/src/nitro/room/index.ts +++ b/src/nitro/room/index.ts @@ -1,11 +1,5 @@ export * from './events'; -export * from './IGetImageListener'; export * from './ImageResult'; -export * from './IRoomContentListener'; -export * from './IRoomCreator'; -export * from './IRoomEngine'; -export * from './IRoomEngineServices'; -export * from './ISelectedRoomObjectData'; export * from './messages'; export * from './object'; export * from './PetColorResult'; diff --git a/src/nitro/room/object/RoomMapData.ts b/src/nitro/room/object/RoomMapData.ts index 92fccd53..6cf0dd2d 100644 --- a/src/nitro/room/object/RoomMapData.ts +++ b/src/nitro/room/object/RoomMapData.ts @@ -1,5 +1,6 @@ +import { IRoomMapData } from '../../../api'; -export class RoomMapData +export class RoomMapData implements IRoomMapData { private _width: number; private _height: number; @@ -122,4 +123,4 @@ export class RoomMapData { this._restrictedScale = scale; } -} \ No newline at end of file +} diff --git a/src/nitro/room/preview/RoomPreviewer.ts b/src/nitro/room/preview/RoomPreviewer.ts index 1954298d..3b7b0fcb 100644 --- a/src/nitro/room/preview/RoomPreviewer.ts +++ b/src/nitro/room/preview/RoomPreviewer.ts @@ -2,7 +2,7 @@ import { RenderTexture, Texture } from '@pixi/core'; import { Container, DisplayObject } from '@pixi/display'; import { Point, Rectangle } from '@pixi/math'; import { Sprite } from '@pixi/sprite'; -import { IObjectData, IRoomObjectController, IRoomRenderingCanvas, IVector3D } from '../../../api'; +import { IGetImageListener, IImageResult, IObjectData, IRoomEngine, IRoomObjectController, IRoomRenderingCanvas, IVector3D } from '../../../api'; import { NitroSprite } from '../../../pixi-proxy'; import { RoomId, Vector3d } from '../../../room'; import { FloorHeightMapMessageParser } from '../../communication/messages/parser/room/mapping/FloorHeightMapMessageParser'; @@ -10,10 +10,6 @@ import { RoomEntryTileMessageParser } from '../../communication/messages/parser/ import { Nitro } from '../../Nitro'; import { RoomEngineEvent } from '../events/RoomEngineEvent'; import { RoomEngineObjectEvent } from '../events/RoomEngineObjectEvent'; -import { IGetImageListener } from '../IGetImageListener'; -import { ImageResult } from '../ImageResult'; -import { IRoomCreator } from '../IRoomCreator'; -import { IRoomEngine } from '../IRoomEngine'; import { ObjectRoomMapUpdateMessage } from '../messages/ObjectRoomMapUpdateMessage'; import { LegacyDataType } from '../object/data/type/LegacyDataType'; import { RoomObjectCategory } from '../object/RoomObjectCategory'; @@ -798,7 +794,7 @@ export class RoomPreviewer return renderingCanvas; } - public getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, objectData: IObjectData = null, state: number = -1, frame: number = -1, posture: string = null): ImageResult + public getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, objectData: IObjectData = null, state: number = -1, frame: number = -1, posture: string = null): IImageResult { if (this.isRoomEngineReady) { @@ -808,7 +804,7 @@ export class RoomPreviewer return null; } - public getRoomObjectImage(direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0): ImageResult + public getRoomObjectImage(direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0): IImageResult { if (this.isRoomEngineReady) { diff --git a/src/nitro/room/utils/FurnitureStackingHeightMap.ts b/src/nitro/room/utils/FurnitureStackingHeightMap.ts index 867585df..f0cccaf9 100644 --- a/src/nitro/room/utils/FurnitureStackingHeightMap.ts +++ b/src/nitro/room/utils/FurnitureStackingHeightMap.ts @@ -1,4 +1,6 @@ -export class FurnitureStackingHeightMap +import { IFurnitureStackingHeightMap } from '../../../api'; + +export class FurnitureStackingHeightMap implements IFurnitureStackingHeightMap { private _width: number; private _height: number; @@ -16,7 +18,7 @@ export class FurnitureStackingHeightMap let total = (width * height); - while(total > 0) + while (total > 0) { this._heights.push(0); this._isNotStackable.push(false); @@ -29,7 +31,7 @@ export class FurnitureStackingHeightMap public dispose(): void { this._width = 0; - this._height =0; + this._height = 0; this._height = null; this._isNotStackable = null; this._isRoomTile = null; @@ -47,17 +49,17 @@ export class FurnitureStackingHeightMap public setTileHeight(x: number, y: number, height: number): void { - if(this.validPosition(x, y)) this._heights[((y * this._width) + x)] = height; + if (this.validPosition(x, y)) this._heights[((y * this._width) + x)] = height; } public setStackingBlocked(x: number, y: number, isNotStackable: boolean): void { - if(this.validPosition(x, y)) this._isNotStackable[((y * this._width) + x)] = isNotStackable; + if (this.validPosition(x, y)) this._isNotStackable[((y * this._width) + x)] = isNotStackable; } public setIsRoomTile(x: number, y: number, isRoomTile: boolean): void { - if(this.validPosition(x, y)) this._isRoomTile[((y * this._width) + x)] = isRoomTile; + if (this.validPosition(x, y)) this._isRoomTile[((y * this._width) + x)] = isRoomTile; } public validateLocation(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: boolean, _arg_10: number = -1): boolean @@ -65,36 +67,36 @@ export class FurnitureStackingHeightMap let _local_12 = 0; let _local_13 = 0; - if(!this.validPosition(k, _arg_2) || !this.validPosition(((k + _arg_3) - 1), ((_arg_2 + _arg_4) - 1))) return false; + if (!this.validPosition(k, _arg_2) || !this.validPosition(((k + _arg_3) - 1), ((_arg_2 + _arg_4) - 1))) return false; - if(((_arg_5 < 0) || (_arg_5 >= this._width))) _arg_5 = 0; + if (((_arg_5 < 0) || (_arg_5 >= this._width))) _arg_5 = 0; - if(((_arg_6 < 0) || (_arg_6 >= this._height))) _arg_6 = 0; + if (((_arg_6 < 0) || (_arg_6 >= this._height))) _arg_6 = 0; _arg_7 = Math.min(_arg_7, (this._width - _arg_5)); _arg_8 = Math.min(_arg_8, (this._height - _arg_6)); - if(_arg_10 === -1) _arg_10 = this.getTileHeight(k, _arg_2); + if (_arg_10 === -1) _arg_10 = this.getTileHeight(k, _arg_2); let _local_11 = _arg_2; - while(_local_11 < (_arg_2 + _arg_4)) + while (_local_11 < (_arg_2 + _arg_4)) { _local_12 = k; - while(_local_12 < (k + _arg_3)) + while (_local_12 < (k + _arg_3)) { - if(((((_local_12 < _arg_5) || (_local_12 >= (_arg_5 + _arg_7))) || (_local_11 < _arg_6)) || (_local_11 >= (_arg_6 + _arg_8)))) + if (((((_local_12 < _arg_5) || (_local_12 >= (_arg_5 + _arg_7))) || (_local_11 < _arg_6)) || (_local_11 >= (_arg_6 + _arg_8)))) { _local_13 = ((_local_11 * this._width) + _local_12); - if(_arg_9) + if (_arg_9) { - if(!this._isRoomTile[_local_13]) return false; + if (!this._isRoomTile[_local_13]) return false; } else { - if(((this._isNotStackable[_local_13]) || (!(this._isRoomTile[_local_13]))) || (Math.abs((this._heights[_local_13] - _arg_10)) > 0.01)) return false; + if (((this._isNotStackable[_local_13]) || (!(this._isRoomTile[_local_13]))) || (Math.abs((this._heights[_local_13] - _arg_10)) > 0.01)) return false; } } @@ -116,4 +118,4 @@ export class FurnitureStackingHeightMap { return this._height; } -} \ No newline at end of file +} diff --git a/src/nitro/room/utils/LegacyWallGeometry.ts b/src/nitro/room/utils/LegacyWallGeometry.ts index 81d06a83..30e60b68 100644 --- a/src/nitro/room/utils/LegacyWallGeometry.ts +++ b/src/nitro/room/utils/LegacyWallGeometry.ts @@ -1,7 +1,7 @@ -import { IVector3D } from '../../../api'; +import { ILegacyWallGeometry, IVector3D } from '../../../api'; import { Vector3d } from '../../../room'; -export class LegacyWallGeometry +export class LegacyWallGeometry implements ILegacyWallGeometry { public static DEFAULT_SCALE: number = 32; diff --git a/src/nitro/room/utils/RoomInstanceData.ts b/src/nitro/room/utils/RoomInstanceData.ts index 0cf0bb0c..974d1f0c 100644 --- a/src/nitro/room/utils/RoomInstanceData.ts +++ b/src/nitro/room/utils/RoomInstanceData.ts @@ -1,8 +1,7 @@ -import { FurnitureStackingHeightMap } from './FurnitureStackingHeightMap'; +import { IFurnitureStackingHeightMap, ILegacyWallGeometry, ISelectedRoomObjectData, ITileObjectMap } from '../../../api'; import { LegacyWallGeometry } from './LegacyWallGeometry'; import { RoomCamera } from './RoomCamera'; import { RoomFurnitureData } from './RoomFurnitureData'; -import { SelectedRoomObjectData } from './SelectedRoomObjectData'; import { TileObjectMap } from './TileObjectMap'; export class RoomInstanceData @@ -10,12 +9,12 @@ export class RoomInstanceData private _roomId: number; private _modelName: string; - private _legacyGeometry: LegacyWallGeometry; - private _tileObjectMap: TileObjectMap; + private _legacyGeometry: ILegacyWallGeometry; + private _tileObjectMap: ITileObjectMap; private _roomCamera: RoomCamera; - private _selectedObject: SelectedRoomObjectData; - private _placedObject: SelectedRoomObjectData; - private _furnitureStackingHeightMap: FurnitureStackingHeightMap; + private _selectedObject: ISelectedRoomObjectData; + private _placedObject: ISelectedRoomObjectData; + private _furnitureStackingHeightMap: IFurnitureStackingHeightMap; private _floorStack: Map; private _wallStack: Map; @@ -48,9 +47,9 @@ export class RoomInstanceData this._modelName = name; } - public setSelectedObject(data: SelectedRoomObjectData): void + public setSelectedObject(data: ISelectedRoomObjectData): void { - if(this._selectedObject) + if (this._selectedObject) { this._selectedObject.dispose(); } @@ -58,9 +57,9 @@ export class RoomInstanceData this._selectedObject = data; } - public setPlacedObject(data: SelectedRoomObjectData): void + public setPlacedObject(data: ISelectedRoomObjectData): void { - if(this._placedObject) + if (this._placedObject) { this._placedObject.dispose(); } @@ -68,15 +67,15 @@ export class RoomInstanceData this._placedObject = data; } - public setFurnitureStackingHeightMap(heightMap: FurnitureStackingHeightMap): void + public setFurnitureStackingHeightMap(heightMap: IFurnitureStackingHeightMap): void { - if(this._furnitureStackingHeightMap) this._furnitureStackingHeightMap.dispose(); + if (this._furnitureStackingHeightMap) this._furnitureStackingHeightMap.dispose(); this._furnitureStackingHeightMap = heightMap; - if(this._tileObjectMap) this._tileObjectMap.dispose(); + if (this._tileObjectMap) this._tileObjectMap.dispose(); - if(this._furnitureStackingHeightMap) + if (this._furnitureStackingHeightMap) { this._tileObjectMap = new TileObjectMap(this._furnitureStackingHeightMap.width, this._furnitureStackingHeightMap.height); } @@ -84,7 +83,7 @@ export class RoomInstanceData public addPendingFurnitureFloor(data: RoomFurnitureData): void { - if(!data) return; + if (!data) return; this._floorStack.delete(data.id); this._floorStack.set(data.id, data); @@ -94,7 +93,7 @@ export class RoomInstanceData { const existing = this._floorStack.get(id); - if(!existing) return null; + if (!existing) return null; this._floorStack.delete(id); @@ -105,7 +104,7 @@ export class RoomInstanceData { const existing = this._floorStack.get(id); - if(!existing) return null; + if (!existing) return null; this._floorStack.delete(id); @@ -114,7 +113,7 @@ export class RoomInstanceData public getNextPendingFurnitureFloor(): RoomFurnitureData { - if(!this._floorStack.size) return null; + if (!this._floorStack.size) return null; const keys = this._floorStack.keys(); @@ -123,7 +122,7 @@ export class RoomInstanceData public addPendingFurnitureWall(data: RoomFurnitureData): void { - if(!data) return; + if (!data) return; this._wallStack.delete(data.id); this._wallStack.set(data.id, data); @@ -133,7 +132,7 @@ export class RoomInstanceData { const existing = this._wallStack.get(id); - if(!existing) return null; + if (!existing) return null; this._wallStack.delete(id); @@ -144,7 +143,7 @@ export class RoomInstanceData { const existing = this._wallStack.get(id); - if(!existing) return null; + if (!existing) return null; this._wallStack.delete(id); @@ -153,7 +152,7 @@ export class RoomInstanceData public getNextPendingFurnitureWall(): RoomFurnitureData { - if(!this._wallStack.size) return null; + if (!this._wallStack.size) return null; const keys = this._wallStack.keys(); @@ -164,7 +163,7 @@ export class RoomInstanceData { const _local_2 = this._mouseButtonCursorOwners.indexOf(k); - if(_local_2 === -1) + if (_local_2 === -1) { this._mouseButtonCursorOwners.push(k); @@ -178,7 +177,7 @@ export class RoomInstanceData { const _local_2 = this._mouseButtonCursorOwners.indexOf(k); - if(_local_2 > -1) + if (_local_2 > -1) { this._mouseButtonCursorOwners.splice(_local_2, 1); @@ -203,12 +202,12 @@ export class RoomInstanceData return this._modelName; } - public get legacyGeometry(): LegacyWallGeometry + public get legacyGeometry(): ILegacyWallGeometry { return this._legacyGeometry; } - public get tileObjectMap(): TileObjectMap + public get tileObjectMap(): ITileObjectMap { return this._tileObjectMap; } @@ -218,17 +217,17 @@ export class RoomInstanceData return this._roomCamera; } - public get selectedObject(): SelectedRoomObjectData + public get selectedObject(): ISelectedRoomObjectData { return this._selectedObject; } - public get placedObject(): SelectedRoomObjectData + public get placedObject(): ISelectedRoomObjectData { return this._placedObject; } - public get furnitureStackingHeightMap(): FurnitureStackingHeightMap + public get furnitureStackingHeightMap(): IFurnitureStackingHeightMap { return this._furnitureStackingHeightMap; } diff --git a/src/nitro/room/utils/SelectedRoomObjectData.ts b/src/nitro/room/utils/SelectedRoomObjectData.ts index 7e0b2e36..21925f50 100644 --- a/src/nitro/room/utils/SelectedRoomObjectData.ts +++ b/src/nitro/room/utils/SelectedRoomObjectData.ts @@ -1,6 +1,5 @@ -import { IObjectData, IVector3D } from '../../../api'; +import { IObjectData, ISelectedRoomObjectData, IVector3D } from '../../../api'; import { Vector3d } from '../../../room'; -import { ISelectedRoomObjectData } from '../ISelectedRoomObjectData'; export class SelectedRoomObjectData implements ISelectedRoomObjectData { diff --git a/src/nitro/room/utils/TileObjectMap.ts b/src/nitro/room/utils/TileObjectMap.ts index a23c73f4..f80ff5e5 100644 --- a/src/nitro/room/utils/TileObjectMap.ts +++ b/src/nitro/room/utils/TileObjectMap.ts @@ -1,8 +1,8 @@ -import { IRoomObject } from '../../../api'; +import { IRoomObject, ITileObjectMap } from '../../../api'; import { NitroLogger } from '../../../core'; import { RoomObjectVariable } from '../object/RoomObjectVariable'; -export class TileObjectMap +export class TileObjectMap implements ITileObjectMap { private _tileObjectMap: Map>; private _width: number; diff --git a/src/nitro/session/RoomSessionManager.ts b/src/nitro/session/RoomSessionManager.ts index aef8f82c..27156ce3 100644 --- a/src/nitro/session/RoomSessionManager.ts +++ b/src/nitro/session/RoomSessionManager.ts @@ -1,7 +1,6 @@ -import { INitroCommunicationManager, IRoomHandlerListener, IRoomSession, IRoomSessionManager } from '../../api'; +import { INitroCommunicationManager, IRoomEngine, IRoomHandlerListener, IRoomSession, IRoomSessionManager } from '../../api'; import { NitroManager } from '../../core'; import { RoomEngineEvent } from '../room/events/RoomEngineEvent'; -import { IRoomEngine } from '../room/IRoomEngine'; import { RoomSessionEvent } from './events/RoomSessionEvent'; import { BaseHandler } from './handler/BaseHandler'; import { GenericErrorHandler } from './handler/GenericErrorHandler';