Continue moving files

This commit is contained in:
Bill 2022-10-30 02:08:37 -04:00
parent 512438f86a
commit f5bb16c3b3
223 changed files with 1559 additions and 1679 deletions

22
src/api/IAdvancedMap.ts Normal file
View File

@ -0,0 +1,22 @@
import { IDisposable } from './common';
export interface IAdvancedMap<T = any, U = any> extends IDisposable
{
dispose(): void;
reset(): void;
unshift(key: T, value: U): boolean;
add(key: T, value: U): boolean;
remove(key: T): U;
getWithIndex(index: number): U;
getKey(index: number): T;
getKeys(): T[];
hasKey(key: T): boolean;
getValue(key: T): U;
getValues(): U[];
hasValue(value: U): boolean;
indexOf(value: U): number;
concatenate(newValues: IAdvancedMap<T, U>): void;
clone(): IAdvancedMap<T, U>;
readonly length: number;
readonly disposed: boolean
}

View File

@ -13,4 +13,12 @@ export * from './common';
export * from './communication';
export * from './communication/enums';
export * from './configuration';
export * from './IAdvancedMap';
export * from './INitroCore';
export * from './nitro';
export * from './room';
export * from './room/object';
export * from './room/object/enum';
export * from './room/object/logic';
export * from './room/object/visualization';
export * from './room/renderer';

View File

@ -0,0 +1,13 @@
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;
}

1
src/api/nitro/index.ts Normal file
View File

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

View File

@ -1,9 +1,8 @@
import { IDisposable } from '../api';
import { IDisposable } from '../../api';
import { IRoomInstanceContainer } from './IRoomInstanceContainer';
import { IRoomObjectManager } from './IRoomObjectManager';
import { IRoomObject } from './object/IRoomObject';
import { IRoomObjectModel } from './object/IRoomObjectModel';
import { IRoomRendererBase } from './renderer/IRoomRendererBase';
import { IRoomObject, IRoomObjectModel } from './object';
import { IRoomRendererBase } from './renderer';
export interface IRoomInstance extends IDisposable
{

View File

@ -1,8 +1,8 @@
import { IRoomObjectManager } from './IRoomObjectManager';
import { IRoomObject } from './object/IRoomObject';
import { IRoomObject } from './object';
export interface IRoomInstanceContainer
{
createRoomObjectAndInitalize(roomId: string, objectId: number, type: string, category: number): IRoomObject;
createRoomObjectManager(category: number): IRoomObjectManager;
}
}

View File

@ -1,7 +1,7 @@
import { IEventDispatcher, INitroManager } from '../api';
import { RoomContentLoader } from '../nitro/room/RoomContentLoader';
import { IEventDispatcher, INitroManager } from '../common';
import { IRoomContentLoader } from '../nitro';
import { IRoomInstance } from './IRoomInstance';
import { IRoomObject } from './object/IRoomObject';
import { IRoomObject } from './object';
export interface IRoomManager extends INitroManager
{
@ -11,7 +11,7 @@ export interface IRoomManager extends INitroManager
addUpdateCategory(category: number): void;
removeUpdateCategory(category: number): void;
createRoomObjectAndInitalize(roomId: string, objectId: number, type: string, category: number): IRoomObject;
setContentLoader(loader: RoomContentLoader): void;
setContentLoader(loader: IRoomContentLoader): void;
update(time: number, update?: boolean): void;
rooms: Map<string, IRoomInstance>;
events: IEventDispatcher;

View File

@ -1,5 +1,5 @@
import { AdvancedMap } from '../core';
import { IRoomObjectController } from './object/IRoomObjectController';
import { IAdvancedMap } from '../IAdvancedMap';
import { IRoomObjectController } from './object';
export interface IRoomObjectManager
{
@ -9,6 +9,6 @@ export interface IRoomObjectManager
createObject(id: number, stateCount: number, type: string): IRoomObjectController;
removeObject(id: number): void;
removeAllObjects(): void;
objects: AdvancedMap<number, IRoomObjectController>;
objects: IAdvancedMap<number, IRoomObjectController>;
totalObjects: number;
}

View File

@ -0,0 +1,7 @@
import { IVector3D } from './IVector3D';
export interface IRoomObjectUpdateMessage
{
readonly location: IVector3D;
readonly direction: IVector3D;
}

View File

@ -0,0 +1,17 @@
export interface IRoomSpriteMouseEvent
{
readonly type: string;
readonly eventId: string;
readonly canvasId: string;
readonly spriteTag: string;
readonly screenX: number;
readonly screenY: number;
readonly localX: number;
readonly localY: number;
readonly ctrlKey: boolean;
readonly altKey: boolean;
readonly shiftKey: boolean;
readonly buttonDown: boolean;
spriteOffsetX: number;
spriteOffsetY: number;
}

10
src/api/room/IVector3D.ts Normal file
View File

@ -0,0 +1,10 @@
export interface IVector3D
{
assign(vector: IVector3D): void;
add(vector: IVector3D): void;
subtract(vector: IVector3D): void;
x: number;
y: number;
z: number;
length: number;
}

15
src/api/room/index.ts Normal file
View File

@ -0,0 +1,15 @@
export * from './IRoomGeometry';
export * from './IRoomInstance';
export * from './IRoomInstanceContainer';
export * from './IRoomManager';
export * from './IRoomManagerListener';
export * from './IRoomObjectManager';
export * from './IRoomObjectUpdateMessage';
export * from './IRoomSpriteMouseEvent';
export * from './IVector3D';
export * from './object';
export * from './object/enum';
export * from './object/logic';
export * from './object/visualization';
export * from './renderer';
export * from './RoomObjectSpriteData';

View File

@ -1,8 +1,8 @@
import { IDisposable } from '../../api';
import { IVector3D } from '../utils/IVector3D';
import { IDisposable } from '../../common';
import { IVector3D } from '../IVector3D';
import { IRoomObjectModel } from './IRoomObjectModel';
import { IRoomObjectMouseHandler } from './logic/IRoomObjectMouseHandler';
import { IRoomObjectVisualization } from './visualization/IRoomObjectVisualization';
import { IRoomObjectMouseHandler } from './logic';
import { IRoomObjectVisualization } from './visualization';
export interface IRoomObject extends IDisposable
{

View File

@ -1,8 +1,8 @@
import { RoomObjectUpdateMessage } from '../messages/RoomObjectUpdateMessage';
import { IVector3D } from '../utils/IVector3D';
import { IRoomObjectUpdateMessage } from '../IRoomObjectUpdateMessage';
import { IVector3D } from '../IVector3D';
import { IRoomObject } from './IRoomObject';
import { IRoomObjectEventHandler } from './logic/IRoomObjectEventHandler';
import { IRoomObjectGraphicVisualization } from './visualization/IRoomObjectGraphicVisualization';
import { IRoomObjectEventHandler } from './logic';
import { IRoomObjectGraphicVisualization } from './visualization';
export interface IRoomObjectController extends IRoomObject
{
@ -11,8 +11,8 @@ export interface IRoomObjectController extends IRoomObject
setState(state: number, index?: number): boolean;
setVisualization(visualization: IRoomObjectGraphicVisualization): void;
setLogic(logic: IRoomObjectEventHandler): void;
processUpdateMessage(message: RoomObjectUpdateMessage): void;
processUpdateMessage(message: IRoomObjectUpdateMessage): void;
tearDown(): void;
isReady: boolean;
logic: IRoomObjectEventHandler;
}
}

View File

@ -1,4 +1,4 @@
import { AdvancedMap } from '../../core';
import { IAdvancedMap } from '../../IAdvancedMap';
import { IRoomObjectModel } from './IRoomObjectModel';
export interface IRoomObjectModelController extends IRoomObjectModel
@ -7,5 +7,5 @@ export interface IRoomObjectModelController extends IRoomObjectModel
setString(_arg_1: string, _arg_2: string, _arg_3: boolean): void;
setNumberArray(_arg_1: string, _arg_2: [], _arg_3: boolean): void;
setStringArray(_arg_1: string, _arg_2: [], _arg_3: boolean): void;
setStringToStringMap(_arg_1: string, _arg_2: AdvancedMap<any, any>, _arg_3: boolean): void;
setStringToStringMap(_arg_1: string, _arg_2: IAdvancedMap<any, any>, _arg_3: boolean): void;
}

View File

@ -0,0 +1,7 @@
export * from './enum';
export * from './IRoomObject';
export * from './IRoomObjectController';
export * from './IRoomObjectModel';
export * from './IRoomObjectModelController';
export * from './logic';
export * from './visualization';

View File

@ -1,5 +1,5 @@
import { IDisposable, IEventDispatcher } from '../../../api';
import { RoomObjectUpdateMessage } from '../../messages/RoomObjectUpdateMessage';
import { IDisposable, IEventDispatcher } from '../../../common';
import { IRoomObjectUpdateMessage } from '../../IRoomObjectUpdateMessage';
import { IRoomObjectController } from '../IRoomObjectController';
import { IRoomObjectMouseHandler } from './IRoomObjectMouseHandler';
@ -7,7 +7,7 @@ export interface IRoomObjectEventHandler extends IRoomObjectMouseHandler, IDispo
{
initialize(data: unknown): void;
update(totalTimeRunning: number): void;
processUpdateMessage(message: RoomObjectUpdateMessage): void;
processUpdateMessage(message: IRoomObjectUpdateMessage): void;
getEventTypes(): string[];
useObject(): void;
setObject(object: IRoomObjectController): void;

View File

@ -1,4 +1,4 @@
import { IEventDispatcher } from '../../../api';
import { IEventDispatcher } from '../../../common';
import { IRoomObjectEventHandler } from './IRoomObjectEventHandler';
export interface IRoomObjectLogicFactory

View File

@ -0,0 +1,7 @@
import { IRoomGeometry } from '../../IRoomGeometry';
import { IRoomSpriteMouseEvent } from '../../IRoomSpriteMouseEvent';
export interface IRoomObjectMouseHandler
{
mouseEvent(event: IRoomSpriteMouseEvent, geometry: IRoomGeometry): void;
}

View File

@ -0,0 +1,3 @@
export * from './IRoomObjectEventHandler';
export * from './IRoomObjectLogicFactory';
export * from './IRoomObjectMouseHandler';

View File

@ -1,4 +1,4 @@
import { IGraphicAssetCollection } from '../../../api';
import { IGraphicAssetCollection } from '../../../asset';
import { IRoomObjectVisualization } from './IRoomObjectVisualization';
export interface IRoomObjectGraphicVisualization extends IRoomObjectVisualization

View File

@ -1,4 +1,4 @@
import { RoomObjectSpriteData } from '../../data/RoomObjectSpriteData';
import { RoomObjectSpriteData } from '../../RoomObjectSpriteData';
import { IRoomObjectGraphicVisualization } from './IRoomObjectGraphicVisualization';
import { IRoomObjectSprite } from './IRoomObjectSprite';
@ -9,4 +9,4 @@ export interface IRoomObjectSpriteVisualization extends IRoomObjectGraphicVisual
sprites: IRoomObjectSprite[];
updateObjectCounter: number;
updateModelCounter: number;
}
}

View File

@ -1,6 +1,6 @@
import { RenderTexture } from '@pixi/core';
import { Rectangle } from '@pixi/math';
import { IRoomGeometry } from '../../utils/IRoomGeometry';
import { IRoomGeometry } from '../../IRoomGeometry';
import { IRoomObject } from '../IRoomObject';
import { IObjectVisualizationData } from './IRoomObjectVisualizationData';

View File

@ -1,4 +1,4 @@
import { IAssetData } from '../../../api';
import { IAssetData } from '../../../asset';
export interface IObjectVisualizationData
{

View File

@ -1,4 +1,4 @@
import { IAssetData } from '../../../api';
import { IAssetData } from '../../../asset';
import { IRoomObjectGraphicVisualization } from './IRoomObjectGraphicVisualization';
import { IObjectVisualizationData } from './IRoomObjectVisualizationData';

View File

@ -0,0 +1,13 @@
import { IRoomGeometry } from '../../IRoomGeometry';
import { IVector3D } from '../../IVector3D';
import { IPlaneDrawingData } from './IPlaneDrawingData';
export interface IRoomPlane
{
uniqueId: number;
location: IVector3D;
leftSide: IVector3D;
rightSide: IVector3D;
color: number;
getDrawingDatas(_arg_1: IRoomGeometry): IPlaneDrawingData[];
}

View File

@ -0,0 +1,10 @@
export * from './IPlaneDrawingData';
export * from './IPlaneVisualization';
export * from './IRoomObjectGraphicVisualization';
export * from './IRoomObjectSprite';
export * from './IRoomObjectSpriteVisualization';
export * from './IRoomObjectVisualization';
export * from './IRoomObjectVisualizationData';
export * from './IRoomObjectVisualizationFactory';
export * from './IRoomPlane';
export * from './ISortableSprite';

View File

@ -0,0 +1,8 @@
import { IRoomGeometry } from '../IRoomGeometry';
import { IRoomSpriteMouseEvent } from '../IRoomSpriteMouseEvent';
import { IRoomObject } from '../object';
export interface IRoomCanvasMouseListener
{
processRoomCanvasMouseEvent(event: IRoomSpriteMouseEvent, object: IRoomObject, geometry: IRoomGeometry): void
}

View File

@ -1,4 +1,4 @@
import { IRoomObject } from '../object/IRoomObject';
import { IRoomObject } from '../object';
export interface IRoomRendererBase
{
@ -7,4 +7,4 @@ export interface IRoomRendererBase
dispose(): void;
reset(): void;
update(time: number, update?: boolean): void;
}
}

View File

@ -1,10 +1,10 @@
import { RenderTexture } from '@pixi/core';
import { DisplayObject } from '@pixi/display';
import { Point } from '@pixi/math';
import { RoomObjectSpriteData } from '../data/RoomObjectSpriteData';
import { IRoomGeometry } from '../utils/IRoomGeometry';
import { IRoomGeometry } from '../IRoomGeometry';
import { ISortableSprite } from '../object';
import { RoomObjectSpriteData } from '../RoomObjectSpriteData';
import { IRoomCanvasMouseListener } from './IRoomCanvasMouseListener';
import { SortableSprite } from './utils/SortableSprite';
export interface IRoomRenderingCanvas
{
@ -17,7 +17,7 @@ export interface IRoomRenderingCanvas
setMouseListener(listener: IRoomCanvasMouseListener): void;
skipSpriteVisibilityChecking(): void;
resumeSpriteVisibilityChecking(): void;
getPlaneSortableSprites(): SortableSprite[];
getPlaneSortableSprites(): ISortableSprite[];
handleMouseEvent(x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): boolean;
getSortableSpriteList(): RoomObjectSpriteData[];
getDisplayAsTexture(): RenderTexture;

View File

@ -1,8 +1,8 @@
import { IRoomObject } from '../object/IRoomObject';
import { IRoomObject } from '../object';
export interface IRoomSpriteCanvasContainer
{
getRoomObject(instanceId: number): IRoomObject;
objects: Map<number, IRoomObject>;
roomObjectVariableAccurateZ: string;
}
}

View File

@ -0,0 +1,6 @@
export * from './IRoomCanvasMouseListener';
export * from './IRoomRenderer';
export * from './IRoomRendererBase';
export * from './IRoomRendererFactory';
export * from './IRoomRenderingCanvas';
export * from './IRoomSpriteCanvasContainer';

View File

@ -1,4 +1,6 @@
export class NitroEvent
import { INitroEvent } from '../../api';
export class NitroEvent implements INitroEvent
{
private _type: string;

View File

@ -1,6 +1,6 @@
import { IDisposable } from '../../api';
import { IAdvancedMap } from '../../api';
export class AdvancedMap<T, U> implements IDisposable
export class AdvancedMap<T, U> implements IAdvancedMap<T, U>
{
private _length: number;
private _dictionary: Map<T, U>;
@ -148,7 +148,7 @@ export class AdvancedMap<T, U> implements IDisposable
for (const k of newValues._keys) this.add(k, newValues.getValue(k));
}
public clone(): AdvancedMap<T, U>
public clone(): IAdvancedMap<T, U>
{
const map = new AdvancedMap<T, U>();

View File

@ -1,7 +1,6 @@
import { Application } from '@pixi/app';
import { Ticker } from '@pixi/ticker';
import { IEventDispatcher, ILinkEventTracker, INitroCore, IWorkerEventTracker } from '../api';
import { IRoomManager } from '../room/IRoomManager';
import { IEventDispatcher, ILinkEventTracker, INitroCore, IRoomManager, IWorkerEventTracker } from '../api';
import { IAvatarRenderManager } from './avatar/IAvatarRenderManager';
import { IRoomCameraWidgetManager } from './camera/IRoomCameraWidgetManager';
import { INitroCommunicationManager } from './communication/INitroCommunicationManager';

View File

@ -2,10 +2,9 @@ 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, INitroCore, IWorkerEventTracker } from '../api';
import { IEventDispatcher, ILinkEventTracker, INitroCore, IRoomManager, IWorkerEventTracker } from '../api';
import { ConfigurationEvent, EventDispatcher, NitroCore, NitroEvent } from '../core';
import { PixiApplicationProxy } from '../pixi-proxy';
import { IRoomManager } from '../room/IRoomManager';
import { RoomManager } from '../room/RoomManager';
import { AvatarRenderManager } from './avatar/AvatarRenderManager';
import { IAvatarRenderManager } from './avatar/IAvatarRenderManager';

View File

@ -1,8 +1,7 @@
import { Texture } from '@pixi/core';
import { Matrix, Point, Rectangle } from '@pixi/math';
import { NitroContainer, NitroSprite } from '../../../pixi-proxy';
import { RoomObjectSpriteData } from '../../../room/data/RoomObjectSpriteData';
import { Nitro } from '../../Nitro';
import { RoomObjectSpriteData } from '../../../api/room/RoomObjectSpriteData';
import { NitroContainer, NitroSprite, PixiApplicationProxy } from '../../../pixi-proxy';
import { IActiveActionData } from '../actions/IActiveActionData';
import { AssetAliasCollection } from '../alias/AssetAliasCollection';
import { AvatarAnimationLayerData } from '../animation/AvatarAnimationLayerData';
@ -87,7 +86,7 @@ export class AvatarImageCache
public disposeInactiveActions(k: number = 60000): void
{
const time = Nitro.instance.time;
const time = PixiApplicationProxy.instance.ticker.lastTime;
if (this._cache)
{

View File

@ -1,6 +1,4 @@
import { IRoomInstance } from '../../room/IRoomInstance';
import { IRoomObjectController } from '../../room/object/IRoomObjectController';
import { IVector3D } from '../../room/utils/IVector3D';
import { IRoomInstance, IRoomObjectController, IVector3D } from '../../api';
import { IRoomSessionManager } from '../session/IRoomSessionManager';
import { ISessionDataManager } from '../session/ISessionDataManager';
import { IObjectData } from './object/data/IObjectData';

View File

@ -1,16 +1,8 @@
import { RenderTexture } from '@pixi/core';
import { DisplayObject } from '@pixi/display';
import { Point, Rectangle } from '@pixi/math';
import { INitroManager } from '../../api';
import { IRoomObject } from '../../room';
import { IRoomManager } from '../../room/IRoomManager';
import { IRoomObjectController } from '../../room/object/IRoomObjectController';
import { IRoomObjectLogicFactory } from '../../room/object/logic/IRoomObjectLogicFactory';
import { IRoomObjectVisualizationFactory } from '../../room/object/visualization/IRoomObjectVisualizationFactory';
import { IRoomRendererFactory } from '../../room/renderer/IRoomRendererFactory';
import { IRoomRenderingCanvas } from '../../room/renderer/IRoomRenderingCanvas';
import { IRoomGeometry } from '../../room/utils/IRoomGeometry';
import { IVector3D } from '../../room/utils/IVector3D';
import { INitroManager, IRoomGeometry, IRoomManager, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRendererFactory, IRoomRenderingCanvas } from '../../api';
import { IVector3D } from '../../api/room/IVector3D';
import { PetCustomPart } from '../avatar/pets/PetCustomPart';
import { IRoomSessionManager } from '../session/IRoomSessionManager';
import { ISessionDataManager } from '../session/ISessionDataManager';

View File

@ -1,8 +1,4 @@
import { IConnection, IEventDispatcher } from '../../api';
import { IRoomInstance } from '../../room/IRoomInstance';
import { IRoomObjectController } from '../../room/object/IRoomObjectController';
import { IRoomRenderingCanvas } from '../../room/renderer/IRoomRenderingCanvas';
import { IVector3D } from '../../room/utils/IVector3D';
import { IConnection, IEventDispatcher, IRoomInstance, IRoomObjectController, IRoomRenderingCanvas, IVector3D } from '../../api';
import { IRoomSessionManager } from '../session/IRoomSessionManager';
import { ISessionDataManager } from '../session/ISessionDataManager';
import { IObjectData } from './object/data/IObjectData';

View File

@ -1,10 +1,10 @@
import { BaseTexture, Resource, Texture } from '@pixi/core';
import { Loader, LoaderResource } from '@pixi/loaders';
import { Spritesheet } from '@pixi/spritesheet';
import { IAssetData, IEventDispatcher, IGraphicAssetCollection, INitroLogger } from '../../api';
import { IAssetData, IEventDispatcher, IGraphicAssetCollection, INitroLogger, IRoomContentLoader } from '../../api';
import { IRoomObject } from '../../api/room/object/IRoomObject';
import { GraphicAssetCollection, GraphicAssetGifCollection, NitroBundle, NitroEvent, NitroLogger } from '../../core';
import { RoomContentLoadedEvent } from '../../room/events/RoomContentLoadedEvent';
import { IRoomObject } from '../../room/object/IRoomObject';
import { Nitro } from '../Nitro';
import { FurnitureType } from '../session/furniture/FurnitureType';
import { IFurnitureData } from '../session/furniture/IFurnitureData';
@ -17,7 +17,7 @@ import { RoomObjectVariable } from './object/RoomObjectVariable';
import { RoomObjectVisualizationType } from './object/RoomObjectVisualizationType';
import { PetColorResult } from './PetColorResult';
export class RoomContentLoader implements IFurnitureDataListener
export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLoader
{
private static PLACE_HOLDER: string = 'place_holder';
private static PLACE_HOLDER_WALL: string = 'place_holder_wall';

View File

@ -1,30 +1,10 @@
import { RenderTexture, Resource, Texture } from '@pixi/core';
import { Container, DisplayObject } from '@pixi/display';
import { Matrix, Point, Rectangle } from '@pixi/math';
import { IConnection, IDisposable, IMessageComposer, IUpdateReceiver } from '../../api';
import { IConnection, IDisposable, IMessageComposer, IRoomGeometry, IRoomInstance, IRoomManager, IRoomManagerListener, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRenderer, IRoomRendererFactory, IRoomRenderingCanvas, IUpdateReceiver, IVector3D } from '../../api';
import { NitroEvent, NitroManager } from '../../core';
import { NitroSprite, TextureUtils } from '../../pixi-proxy';
import { RoomObjectEvent } from '../../room/events/RoomObjectEvent';
import { RoomObjectMouseEvent } from '../../room/events/RoomObjectMouseEvent';
import { IRoomInstance } from '../../room/IRoomInstance';
import { IRoomManager } from '../../room/IRoomManager';
import { IRoomManagerListener } from '../../room/IRoomManagerListener';
import { RoomObjectUpdateMessage } from '../../room/messages/RoomObjectUpdateMessage';
import { IRoomObject } from '../../room/object/IRoomObject';
import { IRoomObjectController } from '../../room/object/IRoomObjectController';
import { IRoomObjectLogicFactory } from '../../room/object/logic/IRoomObjectLogicFactory';
import { IRoomObjectVisualizationFactory } from '../../room/object/visualization/IRoomObjectVisualizationFactory';
import { IRoomRenderer } from '../../room/renderer/IRoomRenderer';
import { IRoomRendererFactory } from '../../room/renderer/IRoomRendererFactory';
import { IRoomRenderingCanvas } from '../../room/renderer/IRoomRenderingCanvas';
import { RoomRendererFactory } from '../../room/renderer/RoomRendererFactory';
import { RoomInstance } from '../../room/RoomInstance';
import { IRoomGeometry } from '../../room/utils/IRoomGeometry';
import { IVector3D } from '../../room/utils/IVector3D';
import { NumberBank } from '../../room/utils/NumberBank';
import { RoomEnterEffect } from '../../room/utils/RoomEnterEffect';
import { RoomGeometry } from '../../room/utils/RoomGeometry';
import { Vector3d } from '../../room/utils/Vector3d';
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';

View File

@ -1,7 +1,6 @@
import { IConnection } from '../../api';
import { IConnection, IVector3D } from '../../api';
import { Disposable } from '../../core';
import { IVector3D } from '../../room/utils/IVector3D';
import { Vector3d } from '../../room/utils/Vector3d';
import { Vector3d } from '../../room';
import { AvatarGuideStatus } from '../avatar/enum/AvatarGuideStatus';
import { PetType } from '../avatar/pets/PetType';
import { ObjectsDataUpdateEvent, PetExperienceEvent } from '../communication';

View File

@ -1,16 +1,10 @@
import { IRoomCanvasMouseListener, IRoomGeometry, IRoomObject, IRoomObjectController, IVector3D } from '../../api';
import { Disposable, NitroLogger } from '../../core';
import { RoomId } from '../../room';
import { RoomEnterEffect, RoomId, Vector3d } from '../../room';
import { RoomObjectEvent } from '../../room/events/RoomObjectEvent';
import { RoomObjectMouseEvent } from '../../room/events/RoomObjectMouseEvent';
import { RoomSpriteMouseEvent } from '../../room/events/RoomSpriteMouseEvent';
import { RoomObjectUpdateMessage } from '../../room/messages/RoomObjectUpdateMessage';
import { IRoomObject } from '../../room/object/IRoomObject';
import { IRoomObjectController } from '../../room/object/IRoomObjectController';
import { IRoomCanvasMouseListener } from '../../room/renderer/IRoomCanvasMouseListener';
import { IRoomGeometry } from '../../room/utils/IRoomGeometry';
import { IVector3D } from '../../room/utils/IVector3D';
import { RoomEnterEffect } from '../../room/utils/RoomEnterEffect';
import { Vector3d } from '../../room/utils/Vector3d';
import { FurnitureGroupInfoComposer, SetObjectDataMessageComposer } from '../communication';
import { GetResolutionAchievementsMessageComposer } from '../communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer';
import { BotPlaceComposer } from '../communication/messages/outgoing/room/engine/BotPlaceComposer';

View File

@ -1,7 +1,5 @@
import { IEventDispatcher } from '../../api';
import { IEventDispatcher, IRoomObjectEventHandler, IRoomObjectLogicFactory } from '../../api';
import { EventDispatcher, NitroLogger } from '../../core';
import { IRoomObjectEventHandler } from '../../room/object/logic/IRoomObjectEventHandler';
import { IRoomObjectLogicFactory } from '../../room/object/logic/IRoomObjectLogicFactory';
import { RoomObjectLogicBase } from '../../room/object/logic/RoomObjectLogicBase';
import { FurnitureEcotronBoxLogic, FurnitureEffectBoxLogic, FurnitureGroupForumTerminalLogic, FurnitureHabboWheelLogic, FurnitureHweenLovelockLogic, FurnitureInternalLinkLogic, FurnitureJukeboxLogic, FurnitureLoveLockLogic, FurnitureMonsterplantSeedLogic, FurnitureMysteryBoxLogic, FurnitureMysteryTrophyLogic, FurniturePlaceholderLogic, FurniturePlanetSystemLogic, FurnitureRandomStateLogic, FurnitureRandomTeleportLogic, FurnitureRentableSpaceLogic, FurnitureSongDiskLogic, FurnitureSoundMachineLogic, FurnitureWelcomeGiftLogic } from './object';
import { AvatarLogic } from './object/logic/avatar/AvatarLogic';

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectBadgeAssetEvent extends RoomObjectEvent
{
@ -25,4 +25,4 @@ export class RoomObjectBadgeAssetEvent extends RoomObjectEvent
{
return this._groupBadge;
}
}
}

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectDataRequestEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
export class RoomObjectDimmerStateUpdateEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectFloorHoleEvent extends RoomObjectEvent
{
@ -10,4 +10,4 @@ export class RoomObjectFloorHoleEvent extends RoomObjectEvent
{
super(k, _arg_2);
}
}
}

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectHSLColorEnableEvent extends RoomObjectEvent
{
@ -39,4 +39,4 @@ export class RoomObjectHSLColorEnableEvent extends RoomObjectEvent
{
return this._lightness;
}
}
}

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectMoveEvent extends RoomObjectEvent
{
@ -10,4 +10,4 @@ export class RoomObjectMoveEvent extends RoomObjectEvent
{
super(k, _arg_2);
}
}
}

View File

@ -1,4 +1,4 @@
import { IRoomObject } from '../../../room';
import { IRoomObject } from '../../../api';
import { RoomObjectFurnitureActionEvent } from './RoomObjectFurnitureActionEvent';
export class RoomObjectPlaySoundIdEvent extends RoomObjectFurnitureActionEvent

View File

@ -1,4 +1,5 @@
import { IRoomObject, RoomObjectEvent } from '../../../room';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectRoomAdEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectSamplePlaybackEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectStateChangedEvent extends RoomObjectEvent
{
@ -19,4 +19,4 @@ export class RoomObjectStateChangedEvent extends RoomObjectEvent
{
return this._state;
}
}
}

View File

@ -1,5 +1,5 @@
import { RoomObjectMouseEvent } from '../../../room/events/RoomObjectMouseEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectMouseEvent } from '../../../room/events/RoomObjectMouseEvent';
export class RoomObjectTileMouseEvent extends RoomObjectMouseEvent
{

View File

@ -1,7 +1,5 @@
import { RoomObjectMouseEvent } from '../../../room/events/RoomObjectMouseEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IVector3D } from '../../../room/utils/IVector3D';
import { Vector3d } from '../../../room/utils/Vector3d';
import { IRoomObject, IVector3D } from '../../../api';
import { RoomObjectMouseEvent, Vector3d } from '../../../room';
export class RoomObjectWallMouseEvent extends RoomObjectMouseEvent
{
@ -58,4 +56,4 @@ export class RoomObjectWallMouseEvent extends RoomObjectMouseEvent
{
return this._direction;
}
}
}

View File

@ -1,5 +1,5 @@
import { RoomObjectEvent } from '../../../room/events/RoomObjectEvent';
import { IRoomObject } from '../../../room/object/IRoomObject';
import { IRoomObject } from '../../../api';
import { RoomObjectEvent } from '../../../room';
export class RoomObjectWidgetRequestEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { RoomToObjectEvent } from '../../../room/events/RoomToObjectEvent';
import { IVector3D } from '../../../room/utils/IVector3D';
import { IVector3D } from '../../../api';
import { RoomToObjectEvent } from '../../../room';
export class RoomToObjectOwnAvatarMoveEvent extends RoomToObjectEvent
{
@ -18,4 +18,4 @@ export class RoomToObjectOwnAvatarMoveEvent extends RoomToObjectEvent
{
return this._targetLocation;
}
}
}

View File

@ -1,4 +1,4 @@
import { IVector3D } from '../../../room/utils/IVector3D';
import { IVector3D } from '../../../api';
import { ObjectMoveUpdateMessage } from './ObjectMoveUpdateMessage';
export class ObjectAvatarUpdateMessage extends ObjectMoveUpdateMessage
@ -30,4 +30,4 @@ export class ObjectAvatarUpdateMessage extends ObjectMoveUpdateMessage
{
return this._baseY;
}
}
}

View File

@ -1,5 +1,5 @@
import { RoomObjectUpdateMessage } from '../../../room/messages/RoomObjectUpdateMessage';
import { IVector3D } from '../../../room/utils/IVector3D';
import { IVector3D } from '../../../api';
import { RoomObjectUpdateMessage } from '../../../room';
export class ObjectHeightUpdateMessage extends RoomObjectUpdateMessage
{
@ -16,4 +16,4 @@ export class ObjectHeightUpdateMessage extends RoomObjectUpdateMessage
{
return this._height;
}
}
}

View File

@ -1,5 +1,5 @@
import { RoomObjectUpdateMessage } from '../../../room/messages/RoomObjectUpdateMessage';
import { IVector3D } from '../../../room/utils/IVector3D';
import { IVector3D } from '../../../api';
import { RoomObjectUpdateMessage } from '../../../room';
export class ObjectMoveUpdateMessage extends RoomObjectUpdateMessage
{
@ -16,7 +16,7 @@ export class ObjectMoveUpdateMessage extends RoomObjectUpdateMessage
public get targetLocation(): IVector3D
{
if(!this._targetLocation) return this.location;
if (!this._targetLocation) return this.location;
return this._targetLocation;
}
@ -25,4 +25,4 @@ export class ObjectMoveUpdateMessage extends RoomObjectUpdateMessage
{
return this._isSlide;
}
}
}

View File

@ -1,6 +1,5 @@
import { RoomObjectUpdateMessage } from '../../../room/messages/RoomObjectUpdateMessage';
import { IVector3D } from '../../../room/utils/IVector3D';
import { Vector3d } from '../../../room/utils/Vector3d';
import { IVector3D } from '../../../api';
import { RoomObjectUpdateMessage, Vector3d } from '../../../room';
export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage
{

View File

@ -1,4 +1,4 @@
import { IVector3D } from '../../../room/utils/IVector3D';
import { IVector3D } from '../../../api';
export class RoomMapMaskData
{
@ -13,4 +13,4 @@ export class RoomMapMaskData
{
return this._masks;
}
}
}

View File

@ -1,9 +1,6 @@
import { IAssetData } from '../../../api';
import { IAssetData, IObjectVisualizationData, IRoomObjectGraphicVisualization, IRoomObjectVisualizationFactory } from '../../../api';
import { NitroLogger } from '../../../core';
import { IRoomObjectGraphicVisualization } from '../../../room/object/visualization/IRoomObjectGraphicVisualization';
import { IObjectVisualizationData } from '../../../room/object/visualization/IRoomObjectVisualizationData';
import { IRoomObjectVisualizationFactory } from '../../../room/object/visualization/IRoomObjectVisualizationFactory';
import { RoomObjectSpriteVisualization } from '../../../room/object/visualization/RoomObjectSpriteVisualization';
import { RoomObjectSpriteVisualization } from '../../../room';
import { Nitro } from '../../Nitro';
import { RoomObjectVisualizationType } from './RoomObjectVisualizationType';
import { AvatarVisualization } from './visualization/avatar/AvatarVisualization';

View File

@ -1,5 +1,5 @@
import { IVector3D } from '../../../room/utils/IVector3D';
import { Vector3d } from '../../../room/utils/Vector3d';
import { IVector3D } from '../../../api';
import { Vector3d } from '../../../room';
export class RoomPlaneBitmapMaskData
{
@ -22,9 +22,9 @@ export class RoomPlaneBitmapMaskData
return this._loc;
}
public set loc(k:IVector3D)
public set loc(k: IVector3D)
{
if(!this._loc) this._loc = new Vector3d();
if (!this._loc) this._loc = new Vector3d();
this._loc.assign(k);
}

View File

@ -1,4 +1,4 @@
import { IVector3D } from '../../../room/utils/IVector3D';
import { IVector3D } from '../../../api';
import { RoomMapMaskData } from './RoomMapMaskData';
import { RoomPlaneBitmapMaskData } from './RoomPlaneBitmapMaskData';
@ -18,7 +18,7 @@ export class RoomPlaneBitmapMaskParser
public dispose(): void
{
if(this._masks)
if (this._masks)
{
this.reset();
@ -28,19 +28,19 @@ export class RoomPlaneBitmapMaskParser
public initialize(k: RoomMapMaskData): boolean
{
if(!k) return false;
if (!k) return false;
this._masks.clear();
if(k.masks.length)
if (k.masks.length)
{
for(const mask of k.masks)
for (const mask of k.masks)
{
if(!mask) continue;
if (!mask) continue;
const location = mask.locations.length ? mask.locations[0] : null;
if(!location) continue;
if (!location) continue;
this._masks.set(mask.id, new RoomPlaneBitmapMaskData(mask.type, location, mask.category));
}
@ -51,9 +51,9 @@ export class RoomPlaneBitmapMaskParser
public reset(): void
{
for(const mask of this._masks.values())
for (const mask of this._masks.values())
{
if(!mask) continue;
if (!mask) continue;
mask.dispose();
}
@ -73,7 +73,7 @@ export class RoomPlaneBitmapMaskParser
{
const existing = this._masks.get(k);
if(existing)
if (existing)
{
this._masks.delete(k);
@ -89,15 +89,15 @@ export class RoomPlaneBitmapMaskParser
{
const data = new RoomMapMaskData();
for(const [ key, mask ] of this._masks.entries())
for (const [key, mask] of this._masks.entries())
{
if(!mask) continue;
if (!mask) continue;
const type = this.getMaskType(mask);
const category = this.getMaskCategory(mask);
const location = this.getMaskLocation(mask);
if(type && category && location)
if (type && category && location)
{
const newMask: any = {
id: key,
@ -121,21 +121,21 @@ export class RoomPlaneBitmapMaskParser
public getMaskLocation(mask: RoomPlaneBitmapMaskData): IVector3D
{
if(!mask) return null;
if (!mask) return null;
return mask.loc;
}
public getMaskType(mask: RoomPlaneBitmapMaskData): string
{
if(!mask) return null;
if (!mask) return null;
return mask.type;
}
public getMaskCategory(mask: RoomPlaneBitmapMaskData): string
{
if(!mask) return null;
if (!mask) return null;
return mask.category;
}

View File

@ -1,5 +1,5 @@
import { IVector3D } from '../../../room/utils/IVector3D';
import { Vector3d } from '../../../room/utils/Vector3d';
import { IVector3D } from '../../../api';
import { Vector3d } from '../../../room';
import { RoomPlaneMaskData } from './RoomPlaneMaskData';
export class RoomPlaneData
@ -38,7 +38,7 @@ export class RoomPlaneData
this._rightSide = new Vector3d();
this._rightSide.assign(_arg_4);
this._type = k;
if(((!(_arg_3 == null)) && (!(_arg_4 == null))))
if (((!(_arg_3 == null)) && (!(_arg_4 == null))))
{
this._normal = Vector3d.crossProduct(_arg_3, _arg_4);
_local_6 = 0;
@ -46,26 +46,26 @@ export class RoomPlaneData
_local_8 = 0;
_local_9 = 0;
_local_10 = 0;
if(((!(this.normal.x == 0)) || (!(this.normal.y == 0))))
if (((!(this.normal.x == 0)) || (!(this.normal.y == 0))))
{
_local_9 = this.normal.x;
_local_10 = this.normal.y;
_local_6 = (360 + ((Math.atan2(_local_10, _local_9) / Math.PI) * 180));
if(_local_6 >= 360)
if (_local_6 >= 360)
{
_local_6 = (_local_6 - 360);
}
_local_9 = Math.sqrt(((this.normal.x * this.normal.x) + (this.normal.y * this.normal.y)));
_local_10 = this.normal.z;
_local_7 = (360 + ((Math.atan2(_local_10, _local_9) / Math.PI) * 180));
if(_local_7 >= 360)
if (_local_7 >= 360)
{
_local_7 = (_local_7 - 360);
}
}
else
{
if(this.normal.z < 0)
if (this.normal.z < 0)
{
_local_7 = 90;
}
@ -76,13 +76,13 @@ export class RoomPlaneData
}
this._normalDirection = new Vector3d(_local_6, _local_7, _local_8);
}
if(((!(_arg_5 == null)) && (_arg_5.length > 0)))
if (((!(_arg_5 == null)) && (_arg_5.length > 0)))
{
_local_11 = 0;
while(_local_11 < _arg_5.length)
while (_local_11 < _arg_5.length)
{
_local_12 = _arg_5[_local_11];
if(((!(_local_12 == null)) && (_local_12.length > 0)))
if (((!(_local_12 == null)) && (_local_12.length > 0)))
{
_local_13 = new Vector3d();
_local_13.assign(_local_12);
@ -136,24 +136,24 @@ export class RoomPlaneData
public getSecondaryNormal(k: number): IVector3D
{
if(((k < 0) || (k >= this.secondaryNormalCount)))
if (((k < 0) || (k >= this.secondaryNormalCount)))
{
return null;
}
const _local_2:Vector3d = new Vector3d();
const _local_2: Vector3d = new Vector3d();
_local_2.assign((this._secondaryNormals[k] as IVector3D));
return _local_2;
}
public addMask(k: number, _arg_2: number, _arg_3: number, _arg_4: number): void
{
const _local_5:RoomPlaneMaskData = new RoomPlaneMaskData(k, _arg_2, _arg_3, _arg_4);
const _local_5: RoomPlaneMaskData = new RoomPlaneMaskData(k, _arg_2, _arg_3, _arg_4);
this._masks.push(_local_5);
}
private getMask(k: number):RoomPlaneMaskData
private getMask(k: number): RoomPlaneMaskData
{
if(((k < 0) || (k >= this.maskCount)))
if (((k < 0) || (k >= this.maskCount)))
{
return null;
}
@ -162,8 +162,8 @@ export class RoomPlaneData
public getMaskLeftSideLoc(k: number): number
{
const _local_2:RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null)
const _local_2: RoomPlaneMaskData = this.getMask(k);
if (_local_2 != null)
{
return _local_2.leftSideLoc;
}
@ -172,8 +172,8 @@ export class RoomPlaneData
public getMaskRightSideLoc(k: number): number
{
const _local_2:RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null)
const _local_2: RoomPlaneMaskData = this.getMask(k);
if (_local_2 != null)
{
return _local_2.rightSideLoc;
}
@ -182,8 +182,8 @@ export class RoomPlaneData
public getMaskLeftSideLength(k: number): number
{
const _local_2:RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null)
const _local_2: RoomPlaneMaskData = this.getMask(k);
if (_local_2 != null)
{
return _local_2.leftSideLength;
}
@ -192,8 +192,8 @@ export class RoomPlaneData
public getMaskRightSideLength(k: number): number
{
const _local_2:RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null)
const _local_2: RoomPlaneMaskData = this.getMask(k);
if (_local_2 != null)
{
return _local_2.rightSideLength;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
import { Point } from '@pixi/math';
import { IVector3D } from '../../../room/utils/IVector3D';
import { Vector3d } from '../../../room/utils/Vector3d';
import { IVector3D } from '../../../api';
import { Vector3d } from '../../../room';
export class RoomWallData
{
@ -47,7 +47,7 @@ export class RoomWallData
public addWall(k: Point, _arg_2: number, _arg_3: number, _arg_4: boolean, _arg_5: boolean): void
{
if(((this._addDuplicates) || (this.checkIsNotDuplicate(k, _arg_2, _arg_3, _arg_4, _arg_5))))
if (((this._addDuplicates) || (this.checkIsNotDuplicate(k, _arg_2, _arg_3, _arg_4, _arg_5))))
{
this._corners.push(k);
this._directions.push(_arg_2);
@ -65,9 +65,9 @@ export class RoomWallData
{
let _local_6 = 0;
while(_local_6 < this._count)
while (_local_6 < this._count)
{
if(((((((this._corners[_local_6].x == k.x) && (this._corners[_local_6].y == k.y)) && (this._directions[_local_6] == _arg_2)) && (this._lengths[_local_6] == _arg_3)) && (this._borders[_local_6] == _arg_4)) && (this._leftTurns[_local_6] == _arg_5)))
if (((((((this._corners[_local_6].x == k.x) && (this._corners[_local_6].y == k.y)) && (this._directions[_local_6] == _arg_2)) && (this._lengths[_local_6] == _arg_3)) && (this._borders[_local_6] == _arg_4)) && (this._leftTurns[_local_6] == _arg_5)))
{
return false;
}
@ -134,7 +134,7 @@ export class RoomWallData
public setLength(k: number, _arg_2: number): void
{
if(_arg_2 < this._lengths[k])
if (_arg_2 < this._lengths[k])
{
this._lengths[k] = _arg_2;
this._manuallyRightCut[k] = true;
@ -144,7 +144,7 @@ export class RoomWallData
public moveCorner(k: number, _arg_2: number): void
{
let _local_3: IVector3D;
if(((_arg_2 > 0) && (_arg_2 < this._lengths[k])))
if (((_arg_2 > 0) && (_arg_2 < this._lengths[k])))
{
const corner = this._corners[k];
@ -160,13 +160,13 @@ export class RoomWallData
let k: number;
let _local_2: Point;
let _local_3: Point;
let _local_4:IVector3D;
let _local_4: IVector3D;
let _local_5: number;
if(this._endPoints.length != this.count)
if (this._endPoints.length != this.count)
{
this._endPoints = [];
k = 0;
while(k < this.count)
while (k < this.count)
{
_local_2 = this.getCorner(k);
_local_3 = new Point(_local_2.x, _local_2.y);

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../api';
import { IRoomObjectModel } from '../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../api';
export interface IObjectData
{

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../api';
import { IRoomObjectModel } from '../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../api';
import { RoomObjectVariable } from '../RoomObjectVariable';
import { IObjectData } from './IObjectData';
import { ObjectDataFlags } from './ObjectDataFlags';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,5 +1,4 @@
import { IMessageDataWrapper } from '../../../../../api';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IMessageDataWrapper, IRoomObjectModel } from '../../../../../api';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { IObjectData } from '../IObjectData';
import { ObjectDataBase } from '../ObjectDataBase';

View File

@ -1,8 +1,5 @@
import { RoomObjectUpdateMessage } from '../../../../room/messages/RoomObjectUpdateMessage';
import { IRoomObjectController } from '../../../../room/object/IRoomObjectController';
import { RoomObjectLogicBase } from '../../../../room/object/logic/RoomObjectLogicBase';
import { IVector3D } from '../../../../room/utils/IVector3D';
import { Vector3d } from '../../../../room/utils/Vector3d';
import { IRoomObjectController, IRoomObjectUpdateMessage, IVector3D } from '../../../../api';
import { RoomObjectLogicBase, Vector3d } from '../../../../room';
import { ObjectMoveUpdateMessage } from '../../messages/ObjectMoveUpdateMessage';
import { RoomObjectVariable } from '../RoomObjectVariable';
@ -46,11 +43,11 @@ export class MovingObjectLogic extends RoomObjectLogicBase
const locationOffset = this.getLocationOffset();
const model = this.object && this.object.model;
if(model)
if (model)
{
if(locationOffset)
if (locationOffset)
{
if(this._liftAmount !== locationOffset.z)
if (this._liftAmount !== locationOffset.z)
{
this._liftAmount = locationOffset.z;
@ -59,7 +56,7 @@ export class MovingObjectLogic extends RoomObjectLogicBase
}
else
{
if(this._liftAmount !== 0)
if (this._liftAmount !== 0)
{
this._liftAmount = 0;
@ -68,17 +65,17 @@ export class MovingObjectLogic extends RoomObjectLogicBase
}
}
if((this._locationDelta.length > 0) || locationOffset)
if ((this._locationDelta.length > 0) || locationOffset)
{
const vector = MovingObjectLogic.TEMP_VECTOR;
let difference = (this.time - this._changeTime);
if(difference === (this._updateInterval >> 1)) difference++;
if (difference === (this._updateInterval >> 1)) difference++;
if(difference > this._updateInterval) difference = this._updateInterval;
if (difference > this._updateInterval) difference = this._updateInterval;
if(this._locationDelta.length > 0)
if (this._locationDelta.length > 0)
{
vector.assign(this._locationDelta);
vector.multiply((difference / this._updateInterval));
@ -89,11 +86,11 @@ export class MovingObjectLogic extends RoomObjectLogicBase
vector.assign(this._location);
}
if(locationOffset) vector.add(locationOffset);
if (locationOffset) vector.add(locationOffset);
this.object.setLocation(vector);
if(difference === this._updateInterval)
if (difference === this._updateInterval)
{
this._locationDelta.x = 0;
this._locationDelta.y = 0;
@ -108,23 +105,23 @@ export class MovingObjectLogic extends RoomObjectLogicBase
{
super.setObject(object);
if(object) this._location.assign(object.getLocation());
if (object) this._location.assign(object.getLocation());
}
public processUpdateMessage(message: RoomObjectUpdateMessage): void
public processUpdateMessage(message: IRoomObjectUpdateMessage): void
{
if(!message) return;
if (!message) return;
super.processUpdateMessage(message);
if(message.location) this._location.assign(message.location);
if (message.location) this._location.assign(message.location);
if(message instanceof ObjectMoveUpdateMessage) return this.processMoveMessage(message);
if (message instanceof ObjectMoveUpdateMessage) return this.processMoveMessage(message);
}
private processMoveMessage(message: ObjectMoveUpdateMessage): void
{
if(!message || !this.object || !message.location) return;
if (!message || !this.object || !message.location) return;
this._changeTime = this._lastUpdateTime;
@ -144,7 +141,7 @@ export class MovingObjectLogic extends RoomObjectLogicBase
protected set updateInterval(interval: number)
{
if(interval <= 0) interval = 1;
if (interval <= 0) interval = 1;
this._updateInterval = interval;
}

View File

@ -1,10 +1,6 @@
import { RoomObjectMouseEvent } from '../../../../../room/events/RoomObjectMouseEvent';
import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent';
import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage';
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry';
import { Vector3d } from '../../../../../room/utils/Vector3d';
import { IRoomGeometry, IRoomObjectModel } from '../../../../../api';
import { RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomSpriteMouseEvent, Vector3d } from '../../../../../room';
import { AvatarAction } from '../../../../avatar/enum/AvatarAction';
import { Nitro } from '../../../../Nitro';
import { MouseEventType } from '../../../../ui/MouseEventType';
@ -83,16 +79,16 @@ export class AvatarLogic extends MovingObjectLogic
public getEventTypes(): string[]
{
const types = [ RoomObjectMouseEvent.CLICK, RoomObjectMoveEvent.POSITION_CHANGED, RoomObjectMouseEvent.MOUSE_ENTER, RoomObjectMouseEvent.MOUSE_LEAVE, RoomObjectFurnitureActionEvent.MOUSE_BUTTON, RoomObjectFurnitureActionEvent.MOUSE_ARROW ];
const types = [RoomObjectMouseEvent.CLICK, RoomObjectMoveEvent.POSITION_CHANGED, RoomObjectMouseEvent.MOUSE_ENTER, RoomObjectMouseEvent.MOUSE_LEAVE, RoomObjectFurnitureActionEvent.MOUSE_BUTTON, RoomObjectFurnitureActionEvent.MOUSE_ARROW];
return this.mergeTypes(super.getEventTypes(), types);
}
public dispose(): void
{
if(this._selected && this.object)
if (this._selected && this.object)
{
if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMoveEvent(RoomObjectMoveEvent.OBJECT_REMOVED, this.object));
if (this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMoveEvent(RoomObjectMoveEvent.OBJECT_REMOVED, this.object));
}
super.dispose();
@ -104,15 +100,15 @@ export class AvatarLogic extends MovingObjectLogic
{
super.update(time);
if(this._selected && this.object)
if (this._selected && this.object)
{
if(this.eventDispatcher)
if (this.eventDispatcher)
{
const location = this.object.getLocation();
if(((!this._reportedLocation || (this._reportedLocation.x !== location.x)) || (this._reportedLocation.y !== location.y)) || (this._reportedLocation.z !== location.z))
if (((!this._reportedLocation || (this._reportedLocation.x !== location.x)) || (this._reportedLocation.y !== location.y)) || (this._reportedLocation.z !== location.z))
{
if(!this._reportedLocation) this._reportedLocation = new Vector3d();
if (!this._reportedLocation) this._reportedLocation = new Vector3d();
this._reportedLocation.assign(location);
@ -123,14 +119,14 @@ export class AvatarLogic extends MovingObjectLogic
const model = this.object && this.object.model;
if(model) this.updateModel(this.time, model);
if (model) this.updateModel(this.time, model);
}
private updateModel(time: number, model: IRoomObjectModel): void
{
if(this._talkingEndTimestamp > 0)
if (this._talkingEndTimestamp > 0)
{
if(time > this._talkingEndTimestamp)
if (time > this._talkingEndTimestamp)
{
model.setValue(RoomObjectVariable.FIGURE_TALK, 0);
@ -140,14 +136,14 @@ export class AvatarLogic extends MovingObjectLogic
}
else
{
if(!this._talkingPauseEndTimestamp && !this._talkingPauseStartTimestamp)
if (!this._talkingPauseEndTimestamp && !this._talkingPauseStartTimestamp)
{
this._talkingPauseStartTimestamp = time + this.randomTalkingPauseStartTimestamp();
this._talkingPauseEndTimestamp = this._talkingPauseStartTimestamp + this.randomTalkingPauseEndTimestamp();
}
else
{
if((this._talkingPauseStartTimestamp > 0) && (time > this._talkingPauseStartTimestamp))
if ((this._talkingPauseStartTimestamp > 0) && (time > this._talkingPauseStartTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_TALK, 0);
@ -155,7 +151,7 @@ export class AvatarLogic extends MovingObjectLogic
}
else
{
if((this._talkingPauseEndTimestamp > 0) && (time > this._talkingPauseEndTimestamp))
if ((this._talkingPauseEndTimestamp > 0) && (time > this._talkingPauseEndTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_TALK, 1);
@ -166,30 +162,30 @@ export class AvatarLogic extends MovingObjectLogic
}
}
if((this._animationEndTimestamp > 0) && (time > this._animationEndTimestamp))
if ((this._animationEndTimestamp > 0) && (time > this._animationEndTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_EXPRESSION, 0);
this._animationEndTimestamp = 0;
}
if((this._gestureEndTimestamp > 0) && (time > this._gestureEndTimestamp))
if ((this._gestureEndTimestamp > 0) && (time > this._gestureEndTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_GESTURE, 0);
this._gestureEndTimestamp = 0;
}
if((this._signEndTimestamp > 0) && (time > this._signEndTimestamp))
if ((this._signEndTimestamp > 0) && (time > this._signEndTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_SIGN, -1);
this._signEndTimestamp = 0;
}
if(this._carryObjectEndTimestamp > 0)
if (this._carryObjectEndTimestamp > 0)
{
if(time > this._carryObjectEndTimestamp)
if (time > this._carryObjectEndTimestamp)
{
model.setValue(RoomObjectVariable.FIGURE_CARRY_OBJECT, 0);
model.setValue(RoomObjectVariable.FIGURE_USE_OBJECT, 0);
@ -200,11 +196,11 @@ export class AvatarLogic extends MovingObjectLogic
}
}
if(this._allowUseCarryObject)
if (this._allowUseCarryObject)
{
if((time - this._carryObjectStartTimestamp) > 5000)
if ((time - this._carryObjectStartTimestamp) > 5000)
{
if(((time - this._carryObjectStartTimestamp) % 10000) < 1000)
if (((time - this._carryObjectStartTimestamp) % 10000) < 1000)
{
model.setValue(RoomObjectVariable.FIGURE_USE_OBJECT, 1);
}
@ -215,7 +211,7 @@ export class AvatarLogic extends MovingObjectLogic
}
}
if((this._blinkingStartTimestamp > -1) && (time > this._blinkingStartTimestamp))
if ((this._blinkingStartTimestamp > -1) && (time > this._blinkingStartTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_BLINK, 1);
@ -223,21 +219,21 @@ export class AvatarLogic extends MovingObjectLogic
this._blinkingEndTimestamp = time + this.randomBlinkEndTimestamp();
}
if((this._blinkingEndTimestamp > 0) && (time > this._blinkingEndTimestamp))
if ((this._blinkingEndTimestamp > 0) && (time > this._blinkingEndTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_BLINK, 0);
this._blinkingEndTimestamp = 0;
}
if((this._effectChangeTimeStamp > 0) && (time > this._effectChangeTimeStamp))
if ((this._effectChangeTimeStamp > 0) && (time > this._effectChangeTimeStamp))
{
model.setValue(RoomObjectVariable.FIGURE_EFFECT, this._newEffect);
this._effectChangeTimeStamp = 0;
}
if((this._numberValueEndTimestamp > 0) && (time > this._numberValueEndTimestamp))
if ((this._numberValueEndTimestamp > 0) && (time > this._numberValueEndTimestamp))
{
model.setValue(RoomObjectVariable.FIGURE_NUMBER_VALUE, 0);
@ -247,15 +243,15 @@ export class AvatarLogic extends MovingObjectLogic
public processUpdateMessage(message: RoomObjectUpdateMessage): void
{
if(!message || !this.object) return;
if (!message || !this.object) return;
super.processUpdateMessage(message);
const model = this.object && this.object.model;
if(!model) return;
if (!model) return;
if(message instanceof ObjectAvatarPostureUpdateMessage)
if (message instanceof ObjectAvatarPostureUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_POSTURE, message.postureType);
model.setValue(RoomObjectVariable.FIGURE_POSTURE_PARAMETER, message.parameter);
@ -263,7 +259,7 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarChatUpdateMessage)
if (message instanceof ObjectAvatarChatUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_TALK, 1);
@ -272,28 +268,28 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarTypingUpdateMessage)
if (message instanceof ObjectAvatarTypingUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_IS_TYPING, message.isTyping ? 1 : 0);
return;
}
if(message instanceof ObjectAvatarMutedUpdateMessage)
if (message instanceof ObjectAvatarMutedUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_IS_MUTED, (message.isMuted ? 1 : 0));
return;
}
if(message instanceof ObjectAvatarPlayingGameUpdateMessage)
if (message instanceof ObjectAvatarPlayingGameUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_IS_PLAYING_GAME, (message.isPlayingGame ? 1 : 0));
return;
}
if(message instanceof ObjectAvatarUpdateMessage)
if (message instanceof ObjectAvatarUpdateMessage)
{
model.setValue(RoomObjectVariable.HEAD_DIRECTION, message.headDirection);
model.setValue(RoomObjectVariable.FIGURE_CAN_STAND_UP, message.canStandUp);
@ -302,7 +298,7 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarGestureUpdateMessage)
if (message instanceof ObjectAvatarGestureUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_GESTURE, message.gesture);
@ -311,35 +307,35 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarExpressionUpdateMessage)
if (message instanceof ObjectAvatarExpressionUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_EXPRESSION, message.expressionType);
this._animationEndTimestamp = AvatarAction.getExpressionTimeout(model.getValue<number>(RoomObjectVariable.FIGURE_EXPRESSION));
if(this._animationEndTimestamp > -1) this._animationEndTimestamp += this.time;
if (this._animationEndTimestamp > -1) this._animationEndTimestamp += this.time;
return;
}
if(message instanceof ObjectAvatarDanceUpdateMessage)
if (message instanceof ObjectAvatarDanceUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_DANCE, message.danceStyle);
return;
}
if(message instanceof ObjectAvatarSleepUpdateMessage)
if (message instanceof ObjectAvatarSleepUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_SLEEP, message.isSleeping ? 1 : 0);
if(message.isSleeping) this._blinkingStartTimestamp = -1;
if (message.isSleeping) this._blinkingStartTimestamp = -1;
else this._blinkingStartTimestamp = (this.time + this.randomBlinkStartTimestamp());
return;
}
if(message instanceof ObjectAvatarPlayerValueUpdateMessage)
if (message instanceof ObjectAvatarPlayerValueUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_NUMBER_VALUE, message.value);
@ -348,19 +344,19 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarEffectUpdateMessage)
if (message instanceof ObjectAvatarEffectUpdateMessage)
{
this.updateAvatarEffect(message.effect, message.delayMilliseconds, model);
return;
}
if(message instanceof ObjectAvatarCarryObjectUpdateMessage)
if (message instanceof ObjectAvatarCarryObjectUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_CARRY_OBJECT, message.itemType);
model.setValue(RoomObjectVariable.FIGURE_USE_OBJECT, 0);
if(message.itemType === 0)
if (message.itemType === 0)
{
this._carryObjectStartTimestamp = 0;
this._carryObjectEndTimestamp = 0;
@ -370,7 +366,7 @@ export class AvatarLogic extends MovingObjectLogic
{
this._carryObjectStartTimestamp = this.time;
if(message.itemType < AvatarLogic.MAX_HAND_ID)
if (message.itemType < AvatarLogic.MAX_HAND_ID)
{
this._carryObjectEndTimestamp = 0;
this._allowUseCarryObject = message.itemType <= AvatarLogic.MAX_HAND_USE_ID;
@ -385,14 +381,14 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarUseObjectUpdateMessage)
if (message instanceof ObjectAvatarUseObjectUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_USE_OBJECT, message.itemType);
return;
}
if(message instanceof ObjectAvatarSignUpdateMessage)
if (message instanceof ObjectAvatarSignUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_SIGN, message.signType);
@ -401,14 +397,14 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarFlatControlUpdateMessage)
if (message instanceof ObjectAvatarFlatControlUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_FLAT_CONTROL, message.level);
return;
}
if(message instanceof ObjectAvatarFigureUpdateMessage)
if (message instanceof ObjectAvatarFigureUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE, message.figure);
model.setValue(RoomObjectVariable.GENDER, message.gender);
@ -416,7 +412,7 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarSelectedMessage)
if (message instanceof ObjectAvatarSelectedMessage)
{
this._selected = message.selected;
this._reportedLocation = null;
@ -424,7 +420,7 @@ export class AvatarLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarOwnMessage)
if (message instanceof ObjectAvatarOwnMessage)
{
model.setValue(RoomObjectVariable.OWN_USER, 1);
@ -434,19 +430,19 @@ export class AvatarLogic extends MovingObjectLogic
private updateAvatarEffect(effect: number, delay: number, model: IRoomObjectModel): void
{
if(effect === AvatarLogic.EFFECT_TYPE_SPLASH)
if (effect === AvatarLogic.EFFECT_TYPE_SPLASH)
{
this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH);
this._newEffect = AvatarLogic.EFFECT_TYPE_SWIM;
}
else if(effect === AvatarLogic.EFFECT_TYPE_SPLASH_DARK)
else if (effect === AvatarLogic.EFFECT_TYPE_SPLASH_DARK)
{
this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH);
this._newEffect = AvatarLogic.EFFECT_TYPE_SWIM_DARK;
}
else if(model.getValue<number>(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic.EFFECT_TYPE_SWIM)
else if (model.getValue<number>(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic.EFFECT_TYPE_SWIM)
{
this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH);
this._newEffect = effect;
@ -454,7 +450,7 @@ export class AvatarLogic extends MovingObjectLogic
effect = AvatarLogic.EFFECT_TYPE_SPLASH;
}
else if(model.getValue<number>(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic.EFFECT_TYPE_SWIM_DARK)
else if (model.getValue<number>(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic.EFFECT_TYPE_SWIM_DARK)
{
this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH);
this._newEffect = effect;
@ -462,7 +458,7 @@ export class AvatarLogic extends MovingObjectLogic
effect = AvatarLogic.EFFECT_TYPE_SPLASH_DARK;
}
else if(delay === 0)
else if (delay === 0)
{
this._effectChangeTimeStamp = 0;
}
@ -482,7 +478,7 @@ export class AvatarLogic extends MovingObjectLogic
{
let eventType: string = null;
switch(event.type)
switch (event.type)
{
case MouseEventType.MOUSE_CLICK:
eventType = RoomObjectMouseEvent.CLICK;
@ -490,20 +486,20 @@ export class AvatarLogic extends MovingObjectLogic
case MouseEventType.ROLL_OVER:
eventType = RoomObjectMouseEvent.MOUSE_ENTER;
if(this.object.model) this.object.model.setValue(RoomObjectVariable.FIGURE_HIGHLIGHT, 1);
if (this.object.model) this.object.model.setValue(RoomObjectVariable.FIGURE_HIGHLIGHT, 1);
if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.MOUSE_BUTTON, this.object));
if (this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.MOUSE_BUTTON, this.object));
break;
case MouseEventType.ROLL_OUT:
eventType = RoomObjectMouseEvent.MOUSE_LEAVE;
if(this.object.model) this.object.model.setValue(RoomObjectVariable.FIGURE_HIGHLIGHT, 0);
if (this.object.model) this.object.model.setValue(RoomObjectVariable.FIGURE_HIGHLIGHT, 0);
if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.MOUSE_ARROW, this.object));
if (this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.MOUSE_ARROW, this.object));
break;
}
if(eventType && this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(eventType, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown));
if (eventType && this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(eventType, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown));
}
private randomTalkingPauseStartTimestamp(): number

View File

@ -1,5 +1,4 @@
import { RoomObjectEvent } from '../../../../../room/events/RoomObjectEvent';
import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage';
import { RoomObjectEvent, RoomObjectUpdateMessage } from '../../../../../room';
import { RoomObjectBadgeAssetEvent } from '../../../events/RoomObjectBadgeAssetEvent';
import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent';
import { ObjectGroupBadgeUpdateMessage } from '../../../messages/ObjectGroupBadgeUpdateMessage';
@ -18,7 +17,7 @@ export class FurnitureAchievementResolutionLogic extends FurnitureBadgeDisplayLo
public getEventTypes(): string[]
{
const types = [ RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_OPEN, RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_ENGRAVING, RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_FAILED, RoomObjectBadgeAssetEvent.LOAD_BADGE ];
const types = [RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_OPEN, RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_ENGRAVING, RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_FAILED, RoomObjectBadgeAssetEvent.LOAD_BADGE];
return this.mergeTypes(super.getEventTypes(), types);
}
@ -27,17 +26,17 @@ export class FurnitureAchievementResolutionLogic extends FurnitureBadgeDisplayLo
{
super.processUpdateMessage(message);
if(message instanceof ObjectGroupBadgeUpdateMessage)
if (message instanceof ObjectGroupBadgeUpdateMessage)
{
if(message.assetName !== 'loading_icon')
if (message.assetName !== 'loading_icon')
{
this.object.model.setValue(RoomObjectVariable.FURNITURE_BADGE_VISIBLE_IN_STATE, FurnitureAchievementResolutionLogic.BADGE_VISIBLE_IN_STATE);
}
}
if(message instanceof ObjectSelectedMessage)
if (message instanceof ObjectSelectedMessage)
{
if(!this.eventDispatcher || !this.object) return;
if (!this.eventDispatcher || !this.object) return;
this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CLOSE_FURNI_CONTEXT_MENU, this.object));
}
@ -45,11 +44,11 @@ export class FurnitureAchievementResolutionLogic extends FurnitureBadgeDisplayLo
public useObject(): void
{
if(!this.object || !this.eventDispatcher) return;
if (!this.object || !this.eventDispatcher) return;
let event: RoomObjectEvent = null;
switch(this.object.getState(0))
switch (this.object.getState(0))
{
case FurnitureAchievementResolutionLogic.STATE_RESOLUTION_NOT_STARTED:
case FurnitureAchievementResolutionLogic.STATE_RESOLUTION_IN_PROGRESS:
@ -63,12 +62,12 @@ export class FurnitureAchievementResolutionLogic extends FurnitureBadgeDisplayLo
break;
}
if(event) this.eventDispatcher.dispatchEvent(event);
if (event) this.eventDispatcher.dispatchEvent(event);
}
protected updateBadge(badgeId: string): void
{
if(badgeId === FurnitureAchievementResolutionLogic.ACH_NOT_SET) return;
if (badgeId === FurnitureAchievementResolutionLogic.ACH_NOT_SET) return;
super.updateBadge(badgeId);
}

View File

@ -1,5 +1,5 @@
import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage';
import { Nitro } from '../../../../Nitro';
import { PixiApplicationProxy } from '../../../../../pixi-proxy';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { RoomObjectBadgeAssetEvent } from '../../../events/RoomObjectBadgeAssetEvent';
import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent';
import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage';
@ -12,7 +12,7 @@ export class FurnitureBadgeDisplayLogic extends FurnitureLogic
{
public getEventTypes(): string[]
{
const types = [ RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING, RoomObjectBadgeAssetEvent.LOAD_BADGE ];
const types = [RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING, RoomObjectBadgeAssetEvent.LOAD_BADGE];
return this.mergeTypes(super.getEventTypes(), types);
}
@ -21,25 +21,25 @@ export class FurnitureBadgeDisplayLogic extends FurnitureLogic
{
super.processUpdateMessage(message);
if(!this.object) return;
if (!this.object) return;
if(message instanceof ObjectDataUpdateMessage)
if (message instanceof ObjectDataUpdateMessage)
{
const data = message.data;
if(data instanceof StringDataType) this.updateBadge(data.getValue(1));
if (data instanceof StringDataType) this.updateBadge(data.getValue(1));
return;
}
if(message instanceof ObjectGroupBadgeUpdateMessage)
if (message instanceof ObjectGroupBadgeUpdateMessage)
{
if(message.assetName !== 'loading_icon')
if (message.assetName !== 'loading_icon')
{
this.object.model.setValue(RoomObjectVariable.FURNITURE_BADGE_ASSET_NAME, message.assetName);
this.object.model.setValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS, 1);
this.update(Nitro.instance.time);
this.update(PixiApplicationProxy.instance.ticker.lastTime);
}
return;
@ -48,16 +48,16 @@ export class FurnitureBadgeDisplayLogic extends FurnitureLogic
public useObject(): void
{
if(!this.object || !this.eventDispatcher) return;
if (!this.object || !this.eventDispatcher) return;
this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING, this.object));
}
protected updateBadge(badgeId: string): void
{
if(badgeId === '') return;
if (badgeId === '') return;
if(this.eventDispatcher)
if (this.eventDispatcher)
{
this.object.model.setValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS, -1);

View File

@ -1,6 +1,5 @@
import { RoomObjectEvent } from '../../../../../room/events/RoomObjectEvent';
import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent';
import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry';
import { IRoomGeometry } from '../../../../../api';
import { RoomObjectEvent, RoomSpriteMouseEvent } from '../../../../../room';
import { MouseEventType } from '../../../../ui/MouseEventType';
import { RoomObjectStateChangedEvent } from '../../../events/RoomObjectStateChangedEvent';
import { FurnitureLogic } from './FurnitureLogic';
@ -9,21 +8,21 @@ export class FurnitureCounterClockLogic extends FurnitureLogic
{
public getEventTypes(): string[]
{
const types = [ RoomObjectStateChangedEvent.STATE_CHANGE ];
const types = [RoomObjectStateChangedEvent.STATE_CHANGE];
return this.mergeTypes(super.getEventTypes(), types);
}
public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void
{
if(!event|| !geometry || !this.object) return;
if (!event || !geometry || !this.object) return;
let objectEvent: RoomObjectEvent = null;
switch(event.type)
switch (event.type)
{
case MouseEventType.DOUBLE_CLICK:
switch(event.spriteTag)
switch (event.spriteTag)
{
case 'start_stop':
objectEvent = new RoomObjectStateChangedEvent(RoomObjectStateChangedEvent.STATE_CHANGE, this.object, 1);
@ -33,7 +32,7 @@ export class FurnitureCounterClockLogic extends FurnitureLogic
break;
}
if(this.eventDispatcher && objectEvent)
if (this.eventDispatcher && objectEvent)
{
this.eventDispatcher.dispatchEvent(objectEvent);
@ -47,7 +46,7 @@ export class FurnitureCounterClockLogic extends FurnitureLogic
public useObject(): void
{
if(!this.object || !this.eventDispatcher) return;
if (!this.object || !this.eventDispatcher) return;
this.eventDispatcher.dispatchEvent(new RoomObjectStateChangedEvent(RoomObjectStateChangedEvent.STATE_CHANGE, this.object, 1));
}

View File

@ -1,4 +1,4 @@
import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { RoomWidgetEnumItemExtradataParameter } from '../../../../ui/widget/enums/RoomWidgetEnumItemExtradataParameter';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { FurnitureLogic } from './FurnitureLogic';
@ -9,9 +9,9 @@ export class FurnitureCrackableLogic extends FurnitureLogic
{
super.processUpdateMessage(message);
if(!this.object) return;
if (!this.object) return;
if(this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1)
if (this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1)
{
this.object.model.setValue(RoomWidgetEnumItemExtradataParameter.INFOSTAND_EXTRA_PARAM, RoomWidgetEnumItemExtradataParameter.CRACKABLE_FURNI);
}

View File

@ -1,6 +1,5 @@
import { RoomObjectEvent } from '../../../../../room/events/RoomObjectEvent';
import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent';
import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry';
import { IRoomGeometry } from '../../../../../api';
import { RoomObjectEvent, RoomSpriteMouseEvent } from '../../../../../room';
import { MouseEventType } from '../../../../ui/MouseEventType';
import { RoomObjectFurnitureActionEvent } from '../../../events/RoomObjectFurnitureActionEvent';
import { FurnitureLogic } from './FurnitureLogic';
@ -20,23 +19,23 @@ export class FurnitureDiceLogic extends FurnitureLogic
public getEventTypes(): string[]
{
const types = [ RoomObjectFurnitureActionEvent.DICE_ACTIVATE, RoomObjectFurnitureActionEvent.DICE_OFF ];
const types = [RoomObjectFurnitureActionEvent.DICE_ACTIVATE, RoomObjectFurnitureActionEvent.DICE_OFF];
return this.mergeTypes(super.getEventTypes(), types);
}
public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void
{
if(!event || !geometry || !this.object) return;
if (!event || !geometry || !this.object) return;
let objectEvent: RoomObjectEvent = null;
switch(event.type)
switch (event.type)
{
case MouseEventType.DOUBLE_CLICK:
if(this._noTags)
if (this._noTags)
{
if(((!(this._noTagsLastStateActivate)) || (this.object.getState(0) === 0)) || (this.object.getState(0) === 100))
if (((!(this._noTagsLastStateActivate)) || (this.object.getState(0) === 0)) || (this.object.getState(0) === 100))
{
objectEvent = new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.DICE_ACTIVATE, this.object);
@ -51,22 +50,22 @@ export class FurnitureDiceLogic extends FurnitureLogic
}
else
{
if(((event.spriteTag === 'activate') || (this.object.getState(0) === 0)) || (this.object.getState(0) === 100))
if (((event.spriteTag === 'activate') || (this.object.getState(0) === 0)) || (this.object.getState(0) === 100))
{
objectEvent = new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.DICE_ACTIVATE, this.object);
}
else if(event.spriteTag === 'deactivate')
else if (event.spriteTag === 'deactivate')
{
objectEvent = new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.DICE_OFF, this.object);
}
}
if(objectEvent && this.eventDispatcher) this.eventDispatcher.dispatchEvent(objectEvent);
if (objectEvent && this.eventDispatcher) this.eventDispatcher.dispatchEvent(objectEvent);
return;
}
super.mouseEvent(event, geometry);
}
}
}

Some files were not shown because too many files have changed in this diff Show More