@rpgjs/common 4.0.0-beta.18 → 4.0.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AbstractObject.js +7 -7
- package/lib/Event.js +1 -1
- package/lib/EventEmitter.js +1 -1
- package/lib/Game.js +6 -6
- package/lib/Hit.js +1 -1
- package/lib/Map.js +5 -5
- package/lib/Module.js +3 -3
- package/lib/Player.js +1 -1
- package/lib/Plugin.js +2 -2
- package/lib/Scheduler.js +2 -2
- package/lib/Shape.js +2 -2
- package/lib/index.js +21 -21
- package/lib/workers/move.js +3 -3
- package/package.json +1 -1
package/lib/AbstractObject.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { intersection, generateUID, toRadians, isInstanceOf } from './Utils';
|
|
2
|
-
import { Hit, HitType } from './Hit';
|
|
3
|
-
import { RpgShape } from './Shape';
|
|
1
|
+
import { intersection, generateUID, toRadians, isInstanceOf } from './Utils.js';
|
|
2
|
+
import { Hit, HitType } from './Hit.js';
|
|
3
|
+
import { RpgShape } from './Shape.js';
|
|
4
4
|
import SAT from 'sat';
|
|
5
|
-
import { RpgCommonMap } from './Map';
|
|
6
|
-
import { RpgPlugin, HookServer } from './Plugin';
|
|
7
|
-
import { GameSide } from './Game';
|
|
8
|
-
import { Vector2d, Vector2dZero } from './Vector2d';
|
|
5
|
+
import { RpgCommonMap } from './Map.js';
|
|
6
|
+
import { RpgPlugin, HookServer } from './Plugin.js';
|
|
7
|
+
import { GameSide } from './Game.js';
|
|
8
|
+
import { Vector2d, Vector2dZero } from './Vector2d.js';
|
|
9
9
|
import { Behavior, Direction, MoveClientMode, PlayerType } from '@rpgjs/types';
|
|
10
10
|
import { from, map, mergeMap, Subject, tap, takeUntil, filter } from 'rxjs';
|
|
11
11
|
const ACTIONS = { IDLE: 0, RUN: 1, ACTION: 2 };
|
package/lib/Event.js
CHANGED
package/lib/EventEmitter.js
CHANGED
package/lib/Game.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { generateUID, isClass } from './Utils';
|
|
2
|
-
import { EventEmitter } from './EventEmitter';
|
|
3
|
-
import { RpgCommonPlayer } from './Player';
|
|
1
|
+
import { generateUID, isClass } from './Utils.js';
|
|
2
|
+
import { EventEmitter } from './EventEmitter.js';
|
|
3
|
+
import { RpgCommonPlayer } from './Player.js';
|
|
4
4
|
import { Control, Direction } from '@rpgjs/types';
|
|
5
|
-
import { RpgPlugin } from './Plugin';
|
|
6
|
-
import { GameWorker } from './Worker';
|
|
7
|
-
import { RpgShape } from './Shape';
|
|
5
|
+
import { RpgPlugin } from './Plugin.js';
|
|
6
|
+
import { GameWorker } from './Worker.js';
|
|
7
|
+
import { RpgShape } from './Shape.js';
|
|
8
8
|
export var GameSide;
|
|
9
9
|
(function (GameSide) {
|
|
10
10
|
GameSide["Server"] = "server";
|
package/lib/Hit.js
CHANGED
package/lib/Map.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Utils, { random, generateUID } from './Utils';
|
|
2
|
-
import { RpgShape } from './Shape';
|
|
3
|
-
import { Hit } from './Hit';
|
|
4
|
-
import { VirtualGrid } from './VirtualGrid';
|
|
1
|
+
import Utils, { random, generateUID } from './Utils.js';
|
|
2
|
+
import { RpgShape } from './Shape.js';
|
|
3
|
+
import { Hit } from './Hit.js';
|
|
4
|
+
import { VirtualGrid } from './VirtualGrid.js';
|
|
5
5
|
import { MapClass } from '@rpgjs/tiled';
|
|
6
|
-
import { AbstractObject } from './AbstractObject';
|
|
6
|
+
import { AbstractObject } from './AbstractObject.js';
|
|
7
7
|
import { map, Subject, takeUntil, mergeMap, from, filter } from 'rxjs';
|
|
8
8
|
const buffer = new Map();
|
|
9
9
|
const bufferClient = new Map();
|
package/lib/Module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RpgPlugin, HookServer, HookClient } from './Plugin';
|
|
2
|
-
import { isArray, isClass, isFunction, isPromise } from './Utils';
|
|
3
|
-
import { warning } from './Logger';
|
|
1
|
+
import { RpgPlugin, HookServer, HookClient } from './Plugin.js';
|
|
2
|
+
import { isArray, isClass, isFunction, isPromise } from './Utils.js';
|
|
3
|
+
import { warning } from './Logger.js';
|
|
4
4
|
var Side;
|
|
5
5
|
(function (Side) {
|
|
6
6
|
Side["Server"] = "server";
|
package/lib/Player.js
CHANGED
package/lib/Plugin.js
CHANGED
package/lib/Scheduler.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import { EventEmitter } from './EventEmitter';
|
|
3
|
-
import Utils from './Utils';
|
|
2
|
+
import { EventEmitter } from './EventEmitter.js';
|
|
3
|
+
import Utils from './Utils.js';
|
|
4
4
|
export class Scheduler extends EventEmitter {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
package/lib/Shape.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Hit, HitType } from './Hit';
|
|
1
|
+
import { Hit, HitType } from './Hit.js';
|
|
2
2
|
import { TiledObjectClass } from '@rpgjs/tiled';
|
|
3
3
|
import { PlayerType } from '@rpgjs/types';
|
|
4
|
-
import { Vector2d } from './Vector2d';
|
|
4
|
+
import { Vector2d } from './Vector2d.js';
|
|
5
5
|
export var ShapePositioning;
|
|
6
6
|
(function (ShapePositioning) {
|
|
7
7
|
ShapePositioning["Default"] = "default";
|
package/lib/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import AbstractObject from './Player';
|
|
2
|
-
export { LiteralDirection, RpgCommonPlayer } from './Player';
|
|
1
|
+
import AbstractObject from './Player.js';
|
|
2
|
+
export { LiteralDirection, RpgCommonPlayer } from './Player.js';
|
|
3
3
|
export { AbstractObject };
|
|
4
|
-
export { RpgCommonEvent } from './Event';
|
|
5
|
-
export { RpgCommonMap } from './Map';
|
|
6
|
-
export { RpgCommonGame, GameSide } from './Game';
|
|
7
|
-
export { EventEmitter } from './EventEmitter';
|
|
8
|
-
export { PrebuiltGui } from './gui/PrebuiltGui';
|
|
9
|
-
export * as Utils from './Utils';
|
|
10
|
-
export { RpgPlugin, HookServer, HookClient } from './Plugin';
|
|
11
|
-
export * as TransportIo from './transports/io';
|
|
4
|
+
export { RpgCommonEvent } from './Event.js';
|
|
5
|
+
export { RpgCommonMap } from './Map.js';
|
|
6
|
+
export { RpgCommonGame, GameSide } from './Game.js';
|
|
7
|
+
export { EventEmitter } from './EventEmitter.js';
|
|
8
|
+
export { PrebuiltGui } from './gui/PrebuiltGui.js';
|
|
9
|
+
export * as Utils from './Utils.js';
|
|
10
|
+
export { RpgPlugin, HookServer, HookClient } from './Plugin.js';
|
|
11
|
+
export * as TransportIo from './transports/io.js';
|
|
12
12
|
export { Input, Control } from '@rpgjs/types';
|
|
13
|
-
export { Hit } from './Hit';
|
|
14
|
-
export { Scheduler } from './Scheduler';
|
|
15
|
-
export { RpgModule, loadModules } from './Module';
|
|
16
|
-
export * as MockIo from './transports/io';
|
|
17
|
-
export * as Logger from './Logger';
|
|
18
|
-
export { RpgShape, ShapePositioning } from './Shape';
|
|
19
|
-
export { VirtualGrid } from './VirtualGrid';
|
|
20
|
-
export { RpgCommonWorldMaps } from './WorldMaps';
|
|
21
|
-
export { Vector2d } from './Vector2d';
|
|
13
|
+
export { Hit } from './Hit.js';
|
|
14
|
+
export { Scheduler } from './Scheduler.js';
|
|
15
|
+
export { RpgModule, loadModules } from './Module.js';
|
|
16
|
+
export * as MockIo from './transports/io.js';
|
|
17
|
+
export * as Logger from './Logger.js';
|
|
18
|
+
export { RpgShape, ShapePositioning } from './Shape.js';
|
|
19
|
+
export { VirtualGrid } from './VirtualGrid.js';
|
|
20
|
+
export { RpgCommonWorldMaps } from './WorldMaps.js';
|
|
21
|
+
export { Vector2d } from './Vector2d.js';
|
|
22
22
|
export { Direction } from '@rpgjs/types';
|
|
23
|
-
export { transitionColor } from './Color';
|
|
24
|
-
export { DefaultInput } from './DefaultInput';
|
|
23
|
+
export { transitionColor } from './Color.js';
|
|
24
|
+
export { DefaultInput } from './DefaultInput.js';
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
package/lib/workers/move.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import workerpool from 'workerpool';
|
|
2
|
-
import { RpgCommonMap } from '../Map';
|
|
3
|
-
import { RpgCommonGame, GameSide } from '../Game';
|
|
4
|
-
import { RpgCommonPlayer } from '../Player';
|
|
2
|
+
import { RpgCommonMap } from '../Map.js';
|
|
3
|
+
import { RpgCommonGame, GameSide } from '../Game.js';
|
|
4
|
+
import { RpgCommonPlayer } from '../Player.js';
|
|
5
5
|
const objects = {};
|
|
6
6
|
let objectsByMap = {};
|
|
7
7
|
const gameEngine = new RpgCommonGame(GameSide.Worker);
|