More changes

This commit is contained in:
Bill 2022-11-02 04:25:40 -04:00
parent ffcbfacbd6
commit baf001a956
43 changed files with 335 additions and 209 deletions

View File

@ -0,0 +1,8 @@
import { Resource, Texture } from '@pixi/core';
export interface IGraphicAssetGifCollection
{
name: string;
textures: Texture<Resource>[];
durations: number[];
}

View File

@ -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';

View File

@ -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;
}

View File

@ -0,0 +1 @@
export * from './pet';

View File

@ -0,0 +1,6 @@
export interface IPetCustomPart
{
layerId: number;
partId: number;
paletteId: number;
}

View File

@ -0,0 +1 @@
export * from './IPetCustomPart';

View File

@ -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';

View File

@ -1,4 +1,4 @@
import { NitroRenderTexture } from '../..';
import { NitroRenderTexture } from '../../../pixi-proxy';
export interface IGetImageListener
{

View File

@ -0,0 +1,9 @@
import { RenderTexture } from '@pixi/core';
export interface IImageResult
{
id: number;
data: RenderTexture;
image: HTMLImageElement;
getImage(): HTMLImageElement;
}

View File

@ -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[];
}

View File

@ -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<Resource>, 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<Resource>[], durations: number[]): IGraphicAssetGifCollection;
getGifCollection(name: string): IGraphicAssetGifCollection;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1,6 @@
import { IRoomObjectController } from '../../room';
export interface IRoomObjectEventManager
{
getValidRoomObjectDirection(k: IRoomObjectController, _arg_2: boolean): number;
}

View File

@ -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;
}

View File

@ -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';

View File

@ -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;
}

View File

@ -0,0 +1 @@
export * from './IRoomMapData';

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -0,0 +1,3 @@
export * from './IFurnitureStackingHeightMap';
export * from './ILegacyWallGeometry';
export * from './ITileObjectMap';

View File

@ -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

View File

@ -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';

View File

@ -1,4 +1,6 @@
export class PetCustomPart
import { IPetCustomPart } from '../../../api';
export class PetCustomPart implements IPetCustomPart
{
private _layerId: number;
private _partId: number;

View File

@ -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;

View File

@ -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;

View File

@ -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'];

View File

@ -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<string, number>;
private _furniRevisions: Map<string, number>;
private _pets: { [index: string]: number };
private _petColors: Map<number, Map<number, PetColorResult>>;
private _petColors: Map<number, Map<number, IPetColorResult>>;
private _objectAliases: Map<string, string>;
private _objectOriginalNames: Map<string, string>;
@ -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<number, PetColorResult> = new Map();
const palettes: Map<number, IPetColorResult> = new Map();
for (const key of keys)
{

View File

@ -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;
}

View File

@ -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';

View File

@ -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;

View File

@ -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';

View File

@ -1,5 +1,6 @@
import { IRoomMapData } from '../../../api';
export class RoomMapData
export class RoomMapData implements IRoomMapData
{
private _width: number;
private _height: number;

View File

@ -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)
{

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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<number, RoomFurnitureData>;
private _wallStack: Map<number, RoomFurnitureData>;
@ -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;
}

View File

@ -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
{

View File

@ -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<number, Map<number, IRoomObject>>;
private _width: number;

View File

@ -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';