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';
export * from './communication/enums'; export * from './communication/enums';
export * from './configuration'; export * from './configuration';
export * from './IAdvancedMap';
export * from './INitroCore'; 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 { IRoomInstanceContainer } from './IRoomInstanceContainer';
import { IRoomObjectManager } from './IRoomObjectManager'; import { IRoomObjectManager } from './IRoomObjectManager';
import { IRoomObject } from './object/IRoomObject'; import { IRoomObject, IRoomObjectModel } from './object';
import { IRoomObjectModel } from './object/IRoomObjectModel'; import { IRoomRendererBase } from './renderer';
import { IRoomRendererBase } from './renderer/IRoomRendererBase';
export interface IRoomInstance extends IDisposable export interface IRoomInstance extends IDisposable
{ {

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { AdvancedMap } from '../core'; import { IAdvancedMap } from '../IAdvancedMap';
import { IRoomObjectController } from './object/IRoomObjectController'; import { IRoomObjectController } from './object';
export interface IRoomObjectManager export interface IRoomObjectManager
{ {
@ -9,6 +9,6 @@ export interface IRoomObjectManager
createObject(id: number, stateCount: number, type: string): IRoomObjectController; createObject(id: number, stateCount: number, type: string): IRoomObjectController;
removeObject(id: number): void; removeObject(id: number): void;
removeAllObjects(): void; removeAllObjects(): void;
objects: AdvancedMap<number, IRoomObjectController>; objects: IAdvancedMap<number, IRoomObjectController>;
totalObjects: number; 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 { IDisposable } from '../../common';
import { IVector3D } from '../utils/IVector3D'; import { IVector3D } from '../IVector3D';
import { IRoomObjectModel } from './IRoomObjectModel'; import { IRoomObjectModel } from './IRoomObjectModel';
import { IRoomObjectMouseHandler } from './logic/IRoomObjectMouseHandler'; import { IRoomObjectMouseHandler } from './logic';
import { IRoomObjectVisualization } from './visualization/IRoomObjectVisualization'; import { IRoomObjectVisualization } from './visualization';
export interface IRoomObject extends IDisposable export interface IRoomObject extends IDisposable
{ {

View File

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

View File

@ -1,4 +1,4 @@
import { AdvancedMap } from '../../core'; import { IAdvancedMap } from '../../IAdvancedMap';
import { IRoomObjectModel } from './IRoomObjectModel'; import { IRoomObjectModel } from './IRoomObjectModel';
export interface IRoomObjectModelController extends 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; setString(_arg_1: string, _arg_2: string, _arg_3: boolean): void;
setNumberArray(_arg_1: string, _arg_2: [], _arg_3: boolean): void; setNumberArray(_arg_1: string, _arg_2: [], _arg_3: boolean): void;
setStringArray(_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 { IDisposable, IEventDispatcher } from '../../../common';
import { RoomObjectUpdateMessage } from '../../messages/RoomObjectUpdateMessage'; import { IRoomObjectUpdateMessage } from '../../IRoomObjectUpdateMessage';
import { IRoomObjectController } from '../IRoomObjectController'; import { IRoomObjectController } from '../IRoomObjectController';
import { IRoomObjectMouseHandler } from './IRoomObjectMouseHandler'; import { IRoomObjectMouseHandler } from './IRoomObjectMouseHandler';
@ -7,7 +7,7 @@ export interface IRoomObjectEventHandler extends IRoomObjectMouseHandler, IDispo
{ {
initialize(data: unknown): void; initialize(data: unknown): void;
update(totalTimeRunning: number): void; update(totalTimeRunning: number): void;
processUpdateMessage(message: RoomObjectUpdateMessage): void; processUpdateMessage(message: IRoomObjectUpdateMessage): void;
getEventTypes(): string[]; getEventTypes(): string[];
useObject(): void; useObject(): void;
setObject(object: IRoomObjectController): void; setObject(object: IRoomObjectController): void;

View File

@ -1,4 +1,4 @@
import { IEventDispatcher } from '../../../api'; import { IEventDispatcher } from '../../../common';
import { IRoomObjectEventHandler } from './IRoomObjectEventHandler'; import { IRoomObjectEventHandler } from './IRoomObjectEventHandler';
export interface IRoomObjectLogicFactory 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'; import { IRoomObjectVisualization } from './IRoomObjectVisualization';
export interface IRoomObjectGraphicVisualization extends 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 { IRoomObjectGraphicVisualization } from './IRoomObjectGraphicVisualization';
import { IRoomObjectSprite } from './IRoomObjectSprite'; import { IRoomObjectSprite } from './IRoomObjectSprite';
@ -9,4 +9,4 @@ export interface IRoomObjectSpriteVisualization extends IRoomObjectGraphicVisual
sprites: IRoomObjectSprite[]; sprites: IRoomObjectSprite[];
updateObjectCounter: number; updateObjectCounter: number;
updateModelCounter: number; updateModelCounter: number;
} }

View File

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

View File

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

View File

@ -1,4 +1,4 @@
import { IAssetData } from '../../../api'; import { IAssetData } from '../../../asset';
import { IRoomObjectGraphicVisualization } from './IRoomObjectGraphicVisualization'; import { IRoomObjectGraphicVisualization } from './IRoomObjectGraphicVisualization';
import { IObjectVisualizationData } from './IRoomObjectVisualizationData'; 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 export interface IRoomRendererBase
{ {
@ -7,4 +7,4 @@ export interface IRoomRendererBase
dispose(): void; dispose(): void;
reset(): void; reset(): void;
update(time: number, update?: boolean): void; update(time: number, update?: boolean): void;
} }

View File

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

View File

@ -1,8 +1,8 @@
import { IRoomObject } from '../object/IRoomObject'; import { IRoomObject } from '../object';
export interface IRoomSpriteCanvasContainer export interface IRoomSpriteCanvasContainer
{ {
getRoomObject(instanceId: number): IRoomObject; getRoomObject(instanceId: number): IRoomObject;
objects: Map<number, IRoomObject>; objects: Map<number, IRoomObject>;
roomObjectVariableAccurateZ: string; 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; 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 _length: number;
private _dictionary: Map<T, U>; 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)); 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>(); const map = new AdvancedMap<T, U>();

View File

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

View File

@ -2,10 +2,9 @@ import { Application, IApplicationOptions } from '@pixi/app';
import { SCALE_MODES } from '@pixi/constants'; import { SCALE_MODES } from '@pixi/constants';
import { settings } from '@pixi/settings'; import { settings } from '@pixi/settings';
import { Ticker } from '@pixi/ticker'; 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 { ConfigurationEvent, EventDispatcher, NitroCore, NitroEvent } from '../core';
import { PixiApplicationProxy } from '../pixi-proxy'; import { PixiApplicationProxy } from '../pixi-proxy';
import { IRoomManager } from '../room/IRoomManager';
import { RoomManager } from '../room/RoomManager'; import { RoomManager } from '../room/RoomManager';
import { AvatarRenderManager } from './avatar/AvatarRenderManager'; import { AvatarRenderManager } from './avatar/AvatarRenderManager';
import { IAvatarRenderManager } from './avatar/IAvatarRenderManager'; import { IAvatarRenderManager } from './avatar/IAvatarRenderManager';

View File

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

View File

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

View File

@ -1,16 +1,8 @@
import { RenderTexture } from '@pixi/core'; import { RenderTexture } from '@pixi/core';
import { DisplayObject } from '@pixi/display'; import { DisplayObject } from '@pixi/display';
import { Point, Rectangle } from '@pixi/math'; import { Point, Rectangle } from '@pixi/math';
import { INitroManager } from '../../api'; import { INitroManager, IRoomGeometry, IRoomManager, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRendererFactory, IRoomRenderingCanvas } from '../../api';
import { IRoomObject } from '../../room'; import { IVector3D } from '../../api/room/IVector3D';
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 { PetCustomPart } from '../avatar/pets/PetCustomPart'; import { PetCustomPart } from '../avatar/pets/PetCustomPart';
import { IRoomSessionManager } from '../session/IRoomSessionManager'; import { IRoomSessionManager } from '../session/IRoomSessionManager';
import { ISessionDataManager } from '../session/ISessionDataManager'; import { ISessionDataManager } from '../session/ISessionDataManager';

View File

@ -1,8 +1,4 @@
import { IConnection, IEventDispatcher } from '../../api'; import { IConnection, IEventDispatcher, IRoomInstance, IRoomObjectController, IRoomRenderingCanvas, IVector3D } 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 { IRoomSessionManager } from '../session/IRoomSessionManager'; import { IRoomSessionManager } from '../session/IRoomSessionManager';
import { ISessionDataManager } from '../session/ISessionDataManager'; import { ISessionDataManager } from '../session/ISessionDataManager';
import { IObjectData } from './object/data/IObjectData'; import { IObjectData } from './object/data/IObjectData';

View File

@ -1,10 +1,10 @@
import { BaseTexture, Resource, Texture } from '@pixi/core'; import { BaseTexture, Resource, Texture } from '@pixi/core';
import { Loader, LoaderResource } from '@pixi/loaders'; import { Loader, LoaderResource } from '@pixi/loaders';
import { Spritesheet } from '@pixi/spritesheet'; 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 { GraphicAssetCollection, GraphicAssetGifCollection, NitroBundle, NitroEvent, NitroLogger } from '../../core';
import { RoomContentLoadedEvent } from '../../room/events/RoomContentLoadedEvent'; import { RoomContentLoadedEvent } from '../../room/events/RoomContentLoadedEvent';
import { IRoomObject } from '../../room/object/IRoomObject';
import { Nitro } from '../Nitro'; import { Nitro } from '../Nitro';
import { FurnitureType } from '../session/furniture/FurnitureType'; import { FurnitureType } from '../session/furniture/FurnitureType';
import { IFurnitureData } from '../session/furniture/IFurnitureData'; import { IFurnitureData } from '../session/furniture/IFurnitureData';
@ -17,7 +17,7 @@ import { RoomObjectVariable } from './object/RoomObjectVariable';
import { RoomObjectVisualizationType } from './object/RoomObjectVisualizationType'; import { RoomObjectVisualizationType } from './object/RoomObjectVisualizationType';
import { PetColorResult } from './PetColorResult'; 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: string = 'place_holder';
private static PLACE_HOLDER_WALL: string = 'place_holder_wall'; private static PLACE_HOLDER_WALL: string = 'place_holder_wall';

View File

@ -1,30 +1,10 @@
import { RenderTexture, Resource, Texture } from '@pixi/core'; import { RenderTexture, Resource, Texture } from '@pixi/core';
import { Container, DisplayObject } from '@pixi/display'; import { Container, DisplayObject } from '@pixi/display';
import { Matrix, Point, Rectangle } from '@pixi/math'; 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 { NitroEvent, NitroManager } from '../../core';
import { NitroSprite, TextureUtils } from '../../pixi-proxy'; import { NitroSprite, TextureUtils } from '../../pixi-proxy';
import { RoomObjectEvent } from '../../room/events/RoomObjectEvent'; import { NumberBank, RoomEnterEffect, RoomGeometry, RoomInstance, RoomObjectEvent, RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomRendererFactory, Vector3d } from '../../room';
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 { PetCustomPart } from '../avatar/pets/PetCustomPart'; import { PetCustomPart } from '../avatar/pets/PetCustomPart';
import { PetFigureData } from '../avatar/pets/PetFigureData'; import { PetFigureData } from '../avatar/pets/PetFigureData';
import { RenderRoomMessageComposer, RenderRoomThumbnailMessageComposer } from '../communication'; 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 { Disposable } from '../../core';
import { IVector3D } from '../../room/utils/IVector3D'; import { Vector3d } from '../../room';
import { Vector3d } from '../../room/utils/Vector3d';
import { AvatarGuideStatus } from '../avatar/enum/AvatarGuideStatus'; import { AvatarGuideStatus } from '../avatar/enum/AvatarGuideStatus';
import { PetType } from '../avatar/pets/PetType'; import { PetType } from '../avatar/pets/PetType';
import { ObjectsDataUpdateEvent, PetExperienceEvent } from '../communication'; 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 { Disposable, NitroLogger } from '../../core';
import { RoomId } from '../../room'; import { RoomEnterEffect, RoomId, Vector3d } from '../../room';
import { RoomObjectEvent } from '../../room/events/RoomObjectEvent'; import { RoomObjectEvent } from '../../room/events/RoomObjectEvent';
import { RoomObjectMouseEvent } from '../../room/events/RoomObjectMouseEvent'; import { RoomObjectMouseEvent } from '../../room/events/RoomObjectMouseEvent';
import { RoomSpriteMouseEvent } from '../../room/events/RoomSpriteMouseEvent'; import { RoomSpriteMouseEvent } from '../../room/events/RoomSpriteMouseEvent';
import { RoomObjectUpdateMessage } from '../../room/messages/RoomObjectUpdateMessage'; 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 { FurnitureGroupInfoComposer, SetObjectDataMessageComposer } from '../communication';
import { GetResolutionAchievementsMessageComposer } from '../communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer'; import { GetResolutionAchievementsMessageComposer } from '../communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer';
import { BotPlaceComposer } from '../communication/messages/outgoing/room/engine/BotPlaceComposer'; 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 { 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 { 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 { 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'; import { AvatarLogic } from './object/logic/avatar/AvatarLogic';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
import { IRoomObject } from '../../../room'; import { IRoomObject } from '../../../api';
import { RoomObjectFurnitureActionEvent } from './RoomObjectFurnitureActionEvent'; import { RoomObjectFurnitureActionEvent } from './RoomObjectFurnitureActionEvent';
export class RoomObjectPlaySoundIdEvent extends 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 export class RoomObjectRoomAdEvent extends RoomObjectEvent
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
import { IVector3D } from '../../../room/utils/IVector3D'; import { IVector3D } from '../../../api';
export class RoomMapMaskData export class RoomMapMaskData
{ {
@ -13,4 +13,4 @@ export class RoomMapMaskData
{ {
return this._masks; 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 { NitroLogger } from '../../../core';
import { IRoomObjectGraphicVisualization } from '../../../room/object/visualization/IRoomObjectGraphicVisualization'; import { RoomObjectSpriteVisualization } from '../../../room';
import { IObjectVisualizationData } from '../../../room/object/visualization/IRoomObjectVisualizationData';
import { IRoomObjectVisualizationFactory } from '../../../room/object/visualization/IRoomObjectVisualizationFactory';
import { RoomObjectSpriteVisualization } from '../../../room/object/visualization/RoomObjectSpriteVisualization';
import { Nitro } from '../../Nitro'; import { Nitro } from '../../Nitro';
import { RoomObjectVisualizationType } from './RoomObjectVisualizationType'; import { RoomObjectVisualizationType } from './RoomObjectVisualizationType';
import { AvatarVisualization } from './visualization/avatar/AvatarVisualization'; import { AvatarVisualization } from './visualization/avatar/AvatarVisualization';

View File

@ -1,5 +1,5 @@
import { IVector3D } from '../../../room/utils/IVector3D'; import { IVector3D } from '../../../api';
import { Vector3d } from '../../../room/utils/Vector3d'; import { Vector3d } from '../../../room';
export class RoomPlaneBitmapMaskData export class RoomPlaneBitmapMaskData
{ {
@ -22,9 +22,9 @@ export class RoomPlaneBitmapMaskData
return this._loc; 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); 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 { RoomMapMaskData } from './RoomMapMaskData';
import { RoomPlaneBitmapMaskData } from './RoomPlaneBitmapMaskData'; import { RoomPlaneBitmapMaskData } from './RoomPlaneBitmapMaskData';
@ -18,7 +18,7 @@ export class RoomPlaneBitmapMaskParser
public dispose(): void public dispose(): void
{ {
if(this._masks) if (this._masks)
{ {
this.reset(); this.reset();
@ -28,19 +28,19 @@ export class RoomPlaneBitmapMaskParser
public initialize(k: RoomMapMaskData): boolean public initialize(k: RoomMapMaskData): boolean
{ {
if(!k) return false; if (!k) return false;
this._masks.clear(); 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; 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)); this._masks.set(mask.id, new RoomPlaneBitmapMaskData(mask.type, location, mask.category));
} }
@ -51,9 +51,9 @@ export class RoomPlaneBitmapMaskParser
public reset(): void 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(); mask.dispose();
} }
@ -73,7 +73,7 @@ export class RoomPlaneBitmapMaskParser
{ {
const existing = this._masks.get(k); const existing = this._masks.get(k);
if(existing) if (existing)
{ {
this._masks.delete(k); this._masks.delete(k);
@ -89,15 +89,15 @@ export class RoomPlaneBitmapMaskParser
{ {
const data = new RoomMapMaskData(); 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 type = this.getMaskType(mask);
const category = this.getMaskCategory(mask); const category = this.getMaskCategory(mask);
const location = this.getMaskLocation(mask); const location = this.getMaskLocation(mask);
if(type && category && location) if (type && category && location)
{ {
const newMask: any = { const newMask: any = {
id: key, id: key,
@ -121,21 +121,21 @@ export class RoomPlaneBitmapMaskParser
public getMaskLocation(mask: RoomPlaneBitmapMaskData): IVector3D public getMaskLocation(mask: RoomPlaneBitmapMaskData): IVector3D
{ {
if(!mask) return null; if (!mask) return null;
return mask.loc; return mask.loc;
} }
public getMaskType(mask: RoomPlaneBitmapMaskData): string public getMaskType(mask: RoomPlaneBitmapMaskData): string
{ {
if(!mask) return null; if (!mask) return null;
return mask.type; return mask.type;
} }
public getMaskCategory(mask: RoomPlaneBitmapMaskData): string public getMaskCategory(mask: RoomPlaneBitmapMaskData): string
{ {
if(!mask) return null; if (!mask) return null;
return mask.category; return mask.category;
} }

View File

@ -1,5 +1,5 @@
import { IVector3D } from '../../../room/utils/IVector3D'; import { IVector3D } from '../../../api';
import { Vector3d } from '../../../room/utils/Vector3d'; import { Vector3d } from '../../../room';
import { RoomPlaneMaskData } from './RoomPlaneMaskData'; import { RoomPlaneMaskData } from './RoomPlaneMaskData';
export class RoomPlaneData export class RoomPlaneData
@ -38,7 +38,7 @@ export class RoomPlaneData
this._rightSide = new Vector3d(); this._rightSide = new Vector3d();
this._rightSide.assign(_arg_4); this._rightSide.assign(_arg_4);
this._type = k; 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); this._normal = Vector3d.crossProduct(_arg_3, _arg_4);
_local_6 = 0; _local_6 = 0;
@ -46,26 +46,26 @@ export class RoomPlaneData
_local_8 = 0; _local_8 = 0;
_local_9 = 0; _local_9 = 0;
_local_10 = 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_9 = this.normal.x;
_local_10 = this.normal.y; _local_10 = this.normal.y;
_local_6 = (360 + ((Math.atan2(_local_10, _local_9) / Math.PI) * 180)); _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_6 = (_local_6 - 360);
} }
_local_9 = Math.sqrt(((this.normal.x * this.normal.x) + (this.normal.y * this.normal.y))); _local_9 = Math.sqrt(((this.normal.x * this.normal.x) + (this.normal.y * this.normal.y)));
_local_10 = this.normal.z; _local_10 = this.normal.z;
_local_7 = (360 + ((Math.atan2(_local_10, _local_9) / Math.PI) * 180)); _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); _local_7 = (_local_7 - 360);
} }
} }
else else
{ {
if(this.normal.z < 0) if (this.normal.z < 0)
{ {
_local_7 = 90; _local_7 = 90;
} }
@ -76,13 +76,13 @@ export class RoomPlaneData
} }
this._normalDirection = new Vector3d(_local_6, _local_7, _local_8); 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; _local_11 = 0;
while(_local_11 < _arg_5.length) while (_local_11 < _arg_5.length)
{ {
_local_12 = _arg_5[_local_11]; _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 = new Vector3d();
_local_13.assign(_local_12); _local_13.assign(_local_12);
@ -136,24 +136,24 @@ export class RoomPlaneData
public getSecondaryNormal(k: number): IVector3D public getSecondaryNormal(k: number): IVector3D
{ {
if(((k < 0) || (k >= this.secondaryNormalCount))) if (((k < 0) || (k >= this.secondaryNormalCount)))
{ {
return null; return null;
} }
const _local_2:Vector3d = new Vector3d(); const _local_2: Vector3d = new Vector3d();
_local_2.assign((this._secondaryNormals[k] as IVector3D)); _local_2.assign((this._secondaryNormals[k] as IVector3D));
return _local_2; return _local_2;
} }
public addMask(k: number, _arg_2: number, _arg_3: number, _arg_4: number): void 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); 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; return null;
} }
@ -162,8 +162,8 @@ export class RoomPlaneData
public getMaskLeftSideLoc(k: number): number public getMaskLeftSideLoc(k: number): number
{ {
const _local_2:RoomPlaneMaskData = this.getMask(k); const _local_2: RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null) if (_local_2 != null)
{ {
return _local_2.leftSideLoc; return _local_2.leftSideLoc;
} }
@ -172,8 +172,8 @@ export class RoomPlaneData
public getMaskRightSideLoc(k: number): number public getMaskRightSideLoc(k: number): number
{ {
const _local_2:RoomPlaneMaskData = this.getMask(k); const _local_2: RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null) if (_local_2 != null)
{ {
return _local_2.rightSideLoc; return _local_2.rightSideLoc;
} }
@ -182,8 +182,8 @@ export class RoomPlaneData
public getMaskLeftSideLength(k: number): number public getMaskLeftSideLength(k: number): number
{ {
const _local_2:RoomPlaneMaskData = this.getMask(k); const _local_2: RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null) if (_local_2 != null)
{ {
return _local_2.leftSideLength; return _local_2.leftSideLength;
} }
@ -192,8 +192,8 @@ export class RoomPlaneData
public getMaskRightSideLength(k: number): number public getMaskRightSideLength(k: number): number
{ {
const _local_2:RoomPlaneMaskData = this.getMask(k); const _local_2: RoomPlaneMaskData = this.getMask(k);
if(_local_2 != null) if (_local_2 != null)
{ {
return _local_2.rightSideLength; 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 { Point } from '@pixi/math';
import { IVector3D } from '../../../room/utils/IVector3D'; import { IVector3D } from '../../../api';
import { Vector3d } from '../../../room/utils/Vector3d'; import { Vector3d } from '../../../room';
export class RoomWallData 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 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._corners.push(k);
this._directions.push(_arg_2); this._directions.push(_arg_2);
@ -65,9 +65,9 @@ export class RoomWallData
{ {
let _local_6 = 0; 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; return false;
} }
@ -134,7 +134,7 @@ export class RoomWallData
public setLength(k: number, _arg_2: number): void 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._lengths[k] = _arg_2;
this._manuallyRightCut[k] = true; this._manuallyRightCut[k] = true;
@ -144,7 +144,7 @@ export class RoomWallData
public moveCorner(k: number, _arg_2: number): void public moveCorner(k: number, _arg_2: number): void
{ {
let _local_3: IVector3D; 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]; const corner = this._corners[k];
@ -160,13 +160,13 @@ export class RoomWallData
let k: number; let k: number;
let _local_2: Point; let _local_2: Point;
let _local_3: Point; let _local_3: Point;
let _local_4:IVector3D; let _local_4: IVector3D;
let _local_5: number; let _local_5: number;
if(this._endPoints.length != this.count) if (this._endPoints.length != this.count)
{ {
this._endPoints = []; this._endPoints = [];
k = 0; k = 0;
while(k < this.count) while (k < this.count)
{ {
_local_2 = this.getCorner(k); _local_2 = this.getCorner(k);
_local_3 = new Point(_local_2.x, _local_2.y); _local_3 = new Point(_local_2.x, _local_2.y);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,5 @@
import { RoomObjectEvent } from '../../../../../room/events/RoomObjectEvent'; import { IRoomGeometry } from '../../../../../api';
import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; import { RoomObjectEvent, RoomSpriteMouseEvent } from '../../../../../room';
import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry';
import { MouseEventType } from '../../../../ui/MouseEventType'; import { MouseEventType } from '../../../../ui/MouseEventType';
import { RoomObjectFurnitureActionEvent } from '../../../events/RoomObjectFurnitureActionEvent'; import { RoomObjectFurnitureActionEvent } from '../../../events/RoomObjectFurnitureActionEvent';
import { FurnitureLogic } from './FurnitureLogic'; import { FurnitureLogic } from './FurnitureLogic';
@ -20,23 +19,23 @@ export class FurnitureDiceLogic extends FurnitureLogic
public getEventTypes(): string[] 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); return this.mergeTypes(super.getEventTypes(), types);
} }
public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void
{ {
if(!event || !geometry || !this.object) return; if (!event || !geometry || !this.object) return;
let objectEvent: RoomObjectEvent = null; let objectEvent: RoomObjectEvent = null;
switch(event.type) switch (event.type)
{ {
case MouseEventType.DOUBLE_CLICK: 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); objectEvent = new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.DICE_ACTIVATE, this.object);
@ -51,22 +50,22 @@ export class FurnitureDiceLogic extends FurnitureLogic
} }
else 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); 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); 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; return;
} }
super.mouseEvent(event, geometry); super.mouseEvent(event, geometry);
} }
} }

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