@rpgjs/common 4.0.0-beta.1 → 4.0.0-beta.11

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.
@@ -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 } from 'rxjs';
11
11
  const ACTIONS = { IDLE: 0, RUN: 1, ACTION: 2 };
package/lib/Event.js CHANGED
@@ -1,4 +1,4 @@
1
- import { RpgCommonPlayer } from './Player';
1
+ import { RpgCommonPlayer } from './Player.js';
2
2
  export class RpgCommonEvent extends RpgCommonPlayer {
3
3
  }
4
4
  //# sourceMappingURL=Event.js.map
@@ -1,4 +1,4 @@
1
- import { isPromise } from './Utils';
1
+ import { isPromise } from './Utils.js';
2
2
  export class EventEmitter {
3
3
  constructor() {
4
4
  this.listeners = {};
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
@@ -1,6 +1,6 @@
1
1
  import { HitType } from '@rpgjs/types';
2
2
  import SAT from 'sat';
3
- import { isInstanceOf } from './Utils';
3
+ import { isInstanceOf } from './Utils.js';
4
4
  export { HitType } from '@rpgjs/types';
5
5
  class HitClass {
6
6
  createObjectHitbox(x, y, z, w, h) {
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.d.ts CHANGED
@@ -23,3 +23,4 @@ export declare class RpgCommonPlayer extends AbstractObject {
23
23
  * */
24
24
  guiDisplay: boolean;
25
25
  }
26
+ export default AbstractObject;
package/lib/Player.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AbstractObject } from './AbstractObject';
1
+ import { AbstractObject } from './AbstractObject.js';
2
2
  export const LiteralDirection = {
3
3
  1: 'up',
4
4
  2: 'right',
@@ -15,4 +15,5 @@ export class RpgCommonPlayer extends AbstractObject {
15
15
  this.inputsTimestamp = {};
16
16
  }
17
17
  }
18
+ export default AbstractObject;
18
19
  //# sourceMappingURL=Player.js.map
package/lib/Player.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Player.js","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;CACZ,CAAA;AAED,MAAM,OAAO,eAAgB,SAAQ,cAAc;IAAnD;;QACI,WAAM,GAAU,EAAE,CAAA;QAClB,cAAS,GAAW,EAAE,CAAA;QACtB,SAAI,GAAQ,EAAE,CAAA;QACd,gBAAW,GAAgB,EAAE,CAAA;QAC7B,oBAAe,GAEX,EAAE,CAAA;IAUV,CAAC;CAAA"}
1
+ {"version":3,"file":"Player.js","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;CACZ,CAAA;AAED,MAAM,OAAO,eAAgB,SAAQ,cAAc;IAAnD;;QACI,WAAM,GAAU,EAAE,CAAA;QAClB,cAAS,GAAW,EAAE,CAAA;QACtB,SAAI,GAAQ,EAAE,CAAA;QACd,gBAAW,GAAgB,EAAE,CAAA;QAC7B,oBAAe,GAEX,EAAE,CAAA;IAUV,CAAC;CAAA;AAED,eAAe,cAAc,CAAA"}
package/lib/Plugin.js CHANGED
@@ -1,5 +1,5 @@
1
- import { EventEmitter } from './EventEmitter';
2
- import { isArray } from './Utils';
1
+ import { EventEmitter } from './EventEmitter.js';
2
+ import { isArray } from './Utils.js';
3
3
  export var HookServer;
4
4
  (function (HookServer) {
5
5
  HookServer["Start"] = "Server.Start";
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.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import AbstractObject from './Player';
1
2
  export { LiteralDirection, RpgCommonPlayer } from './Player';
2
- export { AbstractObject } from './AbstractObject';
3
+ export { AbstractObject };
3
4
  export { RpgCommonEvent } from './Event';
4
5
  export { RpgCommonMap } from './Map';
5
6
  export { RpgCommonGame, GameSide } from './Game';
package/lib/index.js CHANGED
@@ -1,24 +1,25 @@
1
- export { LiteralDirection, RpgCommonPlayer } from './Player';
2
- export { AbstractObject } from './AbstractObject';
3
- export { RpgCommonEvent } from './Event';
4
- export { RpgCommonMap } from './Map';
5
- export { RpgCommonGame, GameSide } from './Game';
6
- export { EventEmitter } from './EventEmitter';
7
- export { PrebuiltGui } from './gui/PrebuiltGui';
8
- export * as Utils from './Utils';
9
- export { RpgPlugin, HookServer, HookClient } from './Plugin';
10
- export * as TransportIo from './transports/io';
1
+ import AbstractObject from './Player.js';
2
+ export { LiteralDirection, RpgCommonPlayer } from './Player.js';
3
+ export { AbstractObject };
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';
11
12
  export { Input, Control } from '@rpgjs/types';
12
- export { Hit } from './Hit';
13
- export { Scheduler } from './Scheduler';
14
- export { RpgModule, loadModules } from './Module';
15
- export * as MockIo from './transports/io';
16
- export * as Logger from './Logger';
17
- export { RpgShape, ShapePositioning } from './Shape';
18
- export { VirtualGrid } from './VirtualGrid';
19
- export { RpgCommonWorldMaps } from './WorldMaps';
20
- 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';
21
22
  export { Direction } from '@rpgjs/types';
22
- export { transitionColor } from './Color';
23
- export { DefaultInput } from './DefaultInput';
23
+ export { transitionColor } from './Color.js';
24
+ export { DefaultInput } from './DefaultInput.js';
24
25
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CA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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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpgjs/common",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.11",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -11,22 +11,20 @@
11
11
  "build": "tsc",
12
12
  "watch": "tsc -w"
13
13
  },
14
- "files": [
15
- "lib"
16
- ],
17
14
  "keywords": [],
18
15
  "author": "Samuel Ronce",
19
16
  "license": "MIT",
20
17
  "dependencies": {
21
- "@rpgjs/tiled": "^4.0.0-beta.1",
22
- "@rpgjs/types": "^4.0.0-beta.1",
18
+ "@rpgjs/tiled": "^4.0.0-beta.11",
19
+ "@rpgjs/types": "^4.0.0-beta.11",
23
20
  "rbush": "^3.0.1",
24
21
  "rxjs": "^7.8.0",
25
22
  "sat": "^0.9.0",
26
23
  "workerpool": "^6.4.0"
27
24
  },
28
- "gitHead": "b12826ef87716da2691da3bae02d7d7c66772789",
25
+ "gitHead": "88732d6fe0158854382ff2e2b9b787393abf19bd",
29
26
  "devDependencies": {
30
27
  "typescript": "^5.0.4"
31
- }
28
+ },
29
+ "type": "module"
32
30
  }