@rpgjs/common 3.0.0-beta.4 → 3.0.0-beta.7
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/Event.d.ts +1 -1
- package/lib/Event.js +3 -2
- package/lib/Event.js.map +1 -1
- package/lib/Game.d.ts +16 -11
- package/lib/Game.js +58 -25
- package/lib/Game.js.map +1 -1
- package/lib/Hit.d.ts +12 -5
- package/lib/Hit.js +22 -10
- package/lib/Hit.js.map +1 -1
- package/lib/Input.d.ts +8 -8
- package/lib/Input.js +8 -8
- package/lib/Input.js.map +1 -1
- package/lib/Map.d.ts +22 -3
- package/lib/Map.js +13 -1
- package/lib/Map.js.map +1 -1
- package/lib/Player.d.ts +35 -25
- package/lib/Player.js +229 -170
- package/lib/Player.js.map +1 -1
- package/lib/Plugin.d.ts +3 -0
- package/lib/Plugin.js +3 -1
- package/lib/Plugin.js.map +1 -1
- package/lib/Scheduler.d.ts +14 -4
- package/lib/Scheduler.js +16 -6
- package/lib/Scheduler.js.map +1 -1
- package/lib/Shape.d.ts +20 -2
- package/lib/Shape.js +69 -20
- package/lib/Shape.js.map +1 -1
- package/lib/Utils.d.ts +4 -12
- package/lib/Utils.js +19 -52
- package/lib/Utils.js.map +1 -1
- package/lib/VirtualGrid.d.ts +27 -0
- package/lib/VirtualGrid.js +75 -0
- package/lib/VirtualGrid.js.map +1 -0
- package/lib/Worker.d.ts +7 -0
- package/lib/Worker.js +21 -0
- package/lib/Worker.js.map +1 -0
- package/lib/index.d.ts +5 -4
- package/lib/index.js +9 -5
- package/lib/index.js.map +1 -1
- package/lib/transports/io.d.ts +6 -5
- package/lib/transports/io.js +14 -0
- package/lib/transports/io.js.map +1 -1
- package/lib/workers/move.d.ts +1 -0
- package/lib/workers/move.js +73 -0
- package/lib/workers/move.js.map +1 -0
- package/package.json +4 -3
package/lib/Scheduler.d.ts
CHANGED
|
@@ -4,10 +4,15 @@ import { EventEmitter } from './EventEmitter';
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
export declare class Scheduler extends EventEmitter {
|
|
7
|
-
options
|
|
7
|
+
private options;
|
|
8
8
|
nextExecTime: any;
|
|
9
|
-
requestedDelay:
|
|
10
|
-
delayCounter:
|
|
9
|
+
requestedDelay: number;
|
|
10
|
+
delayCounter: number;
|
|
11
|
+
timestamp: number;
|
|
12
|
+
lastTimestamp: number;
|
|
13
|
+
deltaTime: number;
|
|
14
|
+
deltaTimeInt: number;
|
|
15
|
+
frame: number;
|
|
11
16
|
/**
|
|
12
17
|
* schedule a function to be called
|
|
13
18
|
*
|
|
@@ -16,7 +21,12 @@ export declare class Scheduler extends EventEmitter {
|
|
|
16
21
|
* @param {Number} options.period number of milliseconds between each invocation, not including the function's execution time
|
|
17
22
|
* @param {Number} options.delay number of milliseconds to add when delaying or hurrying the execution
|
|
18
23
|
*/
|
|
19
|
-
constructor(options:
|
|
24
|
+
constructor(options: {
|
|
25
|
+
tick: Function;
|
|
26
|
+
period: number;
|
|
27
|
+
delay: number;
|
|
28
|
+
stepPeriod?: number;
|
|
29
|
+
});
|
|
20
30
|
nextTickChecker(): void;
|
|
21
31
|
nextTick(): void;
|
|
22
32
|
callTick(): void;
|
package/lib/Scheduler.js
CHANGED
|
@@ -20,6 +20,12 @@ class Scheduler extends EventEmitter_1.EventEmitter {
|
|
|
20
20
|
*/
|
|
21
21
|
constructor(options) {
|
|
22
22
|
super();
|
|
23
|
+
this.options = options;
|
|
24
|
+
this.timestamp = 0;
|
|
25
|
+
this.lastTimestamp = 0;
|
|
26
|
+
this.deltaTime = 0;
|
|
27
|
+
this.deltaTimeInt = 0;
|
|
28
|
+
this.frame = 0;
|
|
23
29
|
this.options = Object.assign({
|
|
24
30
|
tick: null,
|
|
25
31
|
period: SIXTY_PER_SEC,
|
|
@@ -37,28 +43,32 @@ class Scheduler extends EventEmitter_1.EventEmitter {
|
|
|
37
43
|
if (currentTime > this.nextExecTime) {
|
|
38
44
|
this.delayCounter++;
|
|
39
45
|
this.callTick();
|
|
40
|
-
this.nextExecTime = currentTime + this.options.stepPeriod;
|
|
46
|
+
this.nextExecTime = currentTime + (this.options.stepPeriod || 0);
|
|
41
47
|
}
|
|
42
48
|
window.requestAnimationFrame(this.nextTickChecker.bind(this));
|
|
43
49
|
}
|
|
44
50
|
nextTick() {
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
const now = (new Date()).getTime();
|
|
52
|
+
this.deltaTime = now - this.timestamp;
|
|
53
|
+
this.frame++;
|
|
54
|
+
this.deltaTimeInt = Math.round(this.deltaTime / this.options.period);
|
|
55
|
+
this.timestamp = now;
|
|
56
|
+
if (this.timestamp > this.nextExecTime + this.options.period * LOOP_SLOW_THRESH) {
|
|
47
57
|
this.delayCounter++;
|
|
48
58
|
}
|
|
49
59
|
else
|
|
50
60
|
this.delayCounter = 0;
|
|
51
61
|
this.callTick();
|
|
52
|
-
this.nextExecTime =
|
|
62
|
+
this.nextExecTime = this.timestamp + this.options.period + this.requestedDelay;
|
|
53
63
|
this.requestedDelay = 0;
|
|
54
64
|
setTimeout(this.nextTick.bind(this), this.nextExecTime - (new Date()).getTime());
|
|
55
65
|
}
|
|
56
66
|
callTick() {
|
|
57
67
|
if (this.delayCounter >= LOOP_SLOW_COUNT) {
|
|
58
|
-
|
|
68
|
+
console.warn('[RPGJS] Warning, Event Loop is slow !');
|
|
59
69
|
this.delayCounter = 0;
|
|
60
70
|
}
|
|
61
|
-
this.options.tick();
|
|
71
|
+
this.options.tick(this.timestamp, this.deltaTime);
|
|
62
72
|
}
|
|
63
73
|
/**
|
|
64
74
|
* start the schedule
|
package/lib/Scheduler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scheduler.js","sourceRoot":"","sources":["../src/Scheduler.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AAChC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,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,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;IAED;;;OAGG;IACH,KAAK;QACD,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACrC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;YAChF,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,SAAS;QACL,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,SAAS;QACL,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC9C,CAAC;CACJ;AAlGD,8BAkGC"}
|
package/lib/Shape.d.ts
CHANGED
|
@@ -39,6 +39,24 @@ export declare class RpgShape {
|
|
|
39
39
|
get hitbox(): any;
|
|
40
40
|
set hitbox(val: any);
|
|
41
41
|
/**
|
|
42
|
+
* Get/Set width
|
|
43
|
+
* @title width
|
|
44
|
+
* @prop { number } width
|
|
45
|
+
* @since 3.0.0-beta.5
|
|
46
|
+
* @memberof Shape
|
|
47
|
+
*/
|
|
48
|
+
get width(): number;
|
|
49
|
+
set width(val: number);
|
|
50
|
+
/**
|
|
51
|
+
* Get/Set height
|
|
52
|
+
* @title height
|
|
53
|
+
* @prop { number } height
|
|
54
|
+
* @since 3.0.0-beta.5
|
|
55
|
+
* @memberof Shape
|
|
56
|
+
*/
|
|
57
|
+
get height(): number;
|
|
58
|
+
set height(val: number);
|
|
59
|
+
/**
|
|
42
60
|
* Get/Set x
|
|
43
61
|
* @title x
|
|
44
62
|
* @prop { number } x
|
|
@@ -65,8 +83,8 @@ export declare class RpgShape {
|
|
|
65
83
|
set properties(val: any);
|
|
66
84
|
isEvent(): boolean;
|
|
67
85
|
set(obj: ShapeObject): void;
|
|
68
|
-
in(player: RpgCommonPlayer): boolean
|
|
69
|
-
out(player: RpgCommonPlayer): boolean
|
|
86
|
+
in(player: RpgCommonPlayer): Promise<boolean>;
|
|
87
|
+
out(player: RpgCommonPlayer): Promise<boolean>;
|
|
70
88
|
/**
|
|
71
89
|
* Whether the player is in this shape
|
|
72
90
|
*
|
package/lib/Shape.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.RpgShape = exports.ShapePositioning = void 0;
|
|
4
16
|
const Hit_1 = require("./Hit");
|
|
17
|
+
const Utils_1 = require("./Utils");
|
|
18
|
+
const sat_1 = __importDefault(require("sat"));
|
|
5
19
|
var ShapePositioning;
|
|
6
20
|
(function (ShapePositioning) {
|
|
7
21
|
ShapePositioning["Default"] = "default";
|
|
@@ -37,8 +51,13 @@ class RpgShape {
|
|
|
37
51
|
else {
|
|
38
52
|
this.hitbox.pos[type] = val;
|
|
39
53
|
}
|
|
40
|
-
if (this.clientContainer)
|
|
54
|
+
if (this.clientContainer) {
|
|
55
|
+
if (type == 'w')
|
|
56
|
+
type = 'width';
|
|
57
|
+
else if (type == 'h')
|
|
58
|
+
type = 'height';
|
|
41
59
|
this.clientContainer[type] = val;
|
|
60
|
+
}
|
|
42
61
|
}
|
|
43
62
|
get hitbox() {
|
|
44
63
|
if (this.fixEvent) {
|
|
@@ -57,6 +76,32 @@ class RpgShape {
|
|
|
57
76
|
this._hitbox = val;
|
|
58
77
|
}
|
|
59
78
|
/**
|
|
79
|
+
* Get/Set width
|
|
80
|
+
* @title width
|
|
81
|
+
* @prop { number } width
|
|
82
|
+
* @since 3.0.0-beta.5
|
|
83
|
+
* @memberof Shape
|
|
84
|
+
*/
|
|
85
|
+
get width() {
|
|
86
|
+
return this.hitbox.w || 0;
|
|
87
|
+
}
|
|
88
|
+
set width(val) {
|
|
89
|
+
this.setPos('w', val);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get/Set height
|
|
93
|
+
* @title height
|
|
94
|
+
* @prop { number } height
|
|
95
|
+
* @since 3.0.0-beta.5
|
|
96
|
+
* @memberof Shape
|
|
97
|
+
*/
|
|
98
|
+
get height() {
|
|
99
|
+
return this.hitbox.h || 0;
|
|
100
|
+
}
|
|
101
|
+
set height(val) {
|
|
102
|
+
this.setPos('h', val);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
60
105
|
* Get/Set x
|
|
61
106
|
* @title x
|
|
62
107
|
* @prop { number } x
|
|
@@ -102,30 +147,32 @@ class RpgShape {
|
|
|
102
147
|
set(obj) {
|
|
103
148
|
const hit = Hit_1.Hit.getHitbox(obj);
|
|
104
149
|
Object.assign(this, hit);
|
|
105
|
-
this.x = obj.x || 0;
|
|
106
|
-
this.y = obj.y || 0;
|
|
107
150
|
this.positioning = obj.positioning;
|
|
108
151
|
this.fixEvent = obj.fixEvent;
|
|
109
152
|
}
|
|
110
153
|
in(player) {
|
|
111
|
-
|
|
112
|
-
this.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
if (!this.playerIsIn(player)) {
|
|
156
|
+
this.playersIn[player.id] = true;
|
|
157
|
+
player.inShapes[this.name] = this;
|
|
158
|
+
yield player.execMethod('onInShape', [this]);
|
|
159
|
+
yield player.execMethod('onIn', [player], this);
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
163
|
+
});
|
|
119
164
|
}
|
|
120
165
|
out(player) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
if (this.playerIsIn(player)) {
|
|
168
|
+
delete this.playersIn[player.id];
|
|
169
|
+
delete player.inShapes[this.name];
|
|
170
|
+
yield player.execMethod('onOutShape', [this]);
|
|
171
|
+
yield player.execMethod('onOut', [player], this);
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
});
|
|
129
176
|
}
|
|
130
177
|
/**
|
|
131
178
|
* Whether the player is in this shape
|
|
@@ -139,7 +186,9 @@ class RpgShape {
|
|
|
139
186
|
return !!this.playersIn[player.id];
|
|
140
187
|
}
|
|
141
188
|
isShapePosition() {
|
|
142
|
-
return !this.hitbox.
|
|
189
|
+
return !Utils_1.isInstanceOf(this.hitbox, sat_1.default.Polygon)
|
|
190
|
+
&& !Utils_1.isInstanceOf(this.hitbox, sat_1.default.Circle)
|
|
191
|
+
&& !Utils_1.isInstanceOf(this.hitbox, sat_1.default.Box);
|
|
143
192
|
}
|
|
144
193
|
/**
|
|
145
194
|
* Recover the player with the shape. You must have used the `attachShape()` method on the player
|
package/lib/Shape.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shape.js","source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,4BA4MC"}
|
package/lib/Utils.d.ts
CHANGED
|
@@ -17,17 +17,8 @@ export declare function generateUID(): string;
|
|
|
17
17
|
export declare function createConstructor(...propNames: any[]): {
|
|
18
18
|
new (...propValues: any[]): {};
|
|
19
19
|
};
|
|
20
|
-
export declare function
|
|
21
|
-
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
};
|
|
25
|
-
dot_prod_grid: (x: any, y: any, vx: any, vy: any) => number;
|
|
26
|
-
smootherstep: (x: any) => number;
|
|
27
|
-
interp: (x: any, a: any, b: any) => any;
|
|
28
|
-
seed: () => void;
|
|
29
|
-
get: (x: any, y: any) => any;
|
|
30
|
-
};
|
|
20
|
+
export declare function sharedArrayBuffer(): any;
|
|
21
|
+
export declare function toRadians(angle: number): number;
|
|
31
22
|
declare const _default: {
|
|
32
23
|
random: typeof random;
|
|
33
24
|
isBrowser: typeof isBrowser;
|
|
@@ -44,8 +35,9 @@ declare const _default: {
|
|
|
44
35
|
intersection: typeof intersection;
|
|
45
36
|
applyMixins: typeof applyMixins;
|
|
46
37
|
capitalize: typeof capitalize;
|
|
47
|
-
|
|
38
|
+
sharedArrayBuffer: typeof sharedArrayBuffer;
|
|
48
39
|
generateUID: typeof generateUID;
|
|
49
40
|
createConstructor: typeof createConstructor;
|
|
41
|
+
toRadians: typeof toRadians;
|
|
50
42
|
};
|
|
51
43
|
export default _default;
|
package/lib/Utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toRadians = exports.sharedArrayBuffer = exports.createConstructor = exports.generateUID = exports.applyMixins = exports.arrayEquals = exports.capitalize = exports.intersection = exports.arrayFlat = exports.arrayUniq = exports.isInstanceOf = exports.isString = exports.isObject = exports.isArray = exports.isPromise = exports.isClass = exports.isFunction = exports.isBrowser = exports.random = void 0;
|
|
4
4
|
function random(min, max) {
|
|
5
5
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
6
6
|
}
|
|
@@ -90,55 +90,21 @@ function createConstructor(...propNames) {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
exports.createConstructor = createConstructor;
|
|
93
|
-
function
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
return d_vect.x * g_vect.x + d_vect.y * g_vect.y;
|
|
110
|
-
},
|
|
111
|
-
smootherstep: function (x) {
|
|
112
|
-
return 6 * Math.pow(x, 5) - 15 * Math.pow(x, 4) + 10 * Math.pow(x, 3);
|
|
113
|
-
},
|
|
114
|
-
interp: function (x, a, b) {
|
|
115
|
-
return a + this.smootherstep(x) * (b - a);
|
|
116
|
-
},
|
|
117
|
-
seed: function () {
|
|
118
|
-
this.gradients = {};
|
|
119
|
-
this.memory = {};
|
|
120
|
-
},
|
|
121
|
-
get: function (x, y) {
|
|
122
|
-
if (this.memory.hasOwnProperty(`${x},${y}`))
|
|
123
|
-
return this.memory[`${x},${y}`];
|
|
124
|
-
let xf = Math.floor(x);
|
|
125
|
-
let yf = Math.floor(y);
|
|
126
|
-
//interpolate
|
|
127
|
-
let tl = this.dot_prod_grid(x, y, xf, yf);
|
|
128
|
-
let tr = this.dot_prod_grid(x, y, xf + 1, yf);
|
|
129
|
-
let bl = this.dot_prod_grid(x, y, xf, yf + 1);
|
|
130
|
-
let br = this.dot_prod_grid(x, y, xf + 1, yf + 1);
|
|
131
|
-
let xt = this.interp(x - xf, tl, tr);
|
|
132
|
-
let xb = this.interp(x - xf, bl, br);
|
|
133
|
-
let v = this.interp(y - yf, xt, xb);
|
|
134
|
-
this.memory[`${x},${y}`] = v;
|
|
135
|
-
return v;
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
perlin.seed();
|
|
139
|
-
return perlin;
|
|
140
|
-
}
|
|
141
|
-
exports.perlin = perlin;
|
|
93
|
+
function sharedArrayBuffer() {
|
|
94
|
+
let buffer;
|
|
95
|
+
if (typeof SharedArrayBuffer != 'undefined') {
|
|
96
|
+
buffer = SharedArrayBuffer;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
buffer = ArrayBuffer;
|
|
100
|
+
}
|
|
101
|
+
return buffer;
|
|
102
|
+
}
|
|
103
|
+
exports.sharedArrayBuffer = sharedArrayBuffer;
|
|
104
|
+
function toRadians(angle) {
|
|
105
|
+
return angle * (Math.PI / 180);
|
|
106
|
+
}
|
|
107
|
+
exports.toRadians = toRadians;
|
|
142
108
|
exports.default = {
|
|
143
109
|
random,
|
|
144
110
|
isBrowser,
|
|
@@ -155,8 +121,9 @@ exports.default = {
|
|
|
155
121
|
intersection,
|
|
156
122
|
applyMixins,
|
|
157
123
|
capitalize,
|
|
158
|
-
|
|
124
|
+
sharedArrayBuffer,
|
|
159
125
|
generateUID,
|
|
160
|
-
createConstructor
|
|
126
|
+
createConstructor,
|
|
127
|
+
toRadians
|
|
161
128
|
};
|
|
162
129
|
//# sourceMappingURL=Utils.js.map
|
package/lib/Utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../src/Utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,MAAM,CAAC,GAAG,EAAE,GAAG;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAA;AAC5D,CAAC;AAFD,wBAEC;AAED,SAAgB,SAAS;IACrB,OAAO,OAAO,MAAM,KAAK,WAAW,CAAA;AACxC,CAAC;AAFD,8BAEC;AAED,SAAgB,UAAU,CAAC,GAAG;IAC1B,OAAO,EAAE,CAAC,QA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maxY: number;
|
|
6
|
+
};
|
|
7
|
+
export declare class VirtualGrid {
|
|
8
|
+
private nbCellWidth;
|
|
9
|
+
private cellWidth;
|
|
10
|
+
private cellHeight;
|
|
11
|
+
private cells;
|
|
12
|
+
private inverseCells;
|
|
13
|
+
constructor(nbCellWidth: number, cellWidth: number, cellHeight: number);
|
|
14
|
+
zoom(nbCell: number): VirtualGrid;
|
|
15
|
+
getCellIndex(x: number, y: number): number;
|
|
16
|
+
private getCells;
|
|
17
|
+
getObjectsByBox(box: Box): Set<string>;
|
|
18
|
+
getObjectsById(id: string): Set<string>;
|
|
19
|
+
clearObjectInCells(id: string): void;
|
|
20
|
+
insertInCells(id: string, box: {
|
|
21
|
+
minX: number;
|
|
22
|
+
minY: number;
|
|
23
|
+
maxX: number;
|
|
24
|
+
maxY: number;
|
|
25
|
+
}): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VirtualGrid = void 0;
|
|
4
|
+
class VirtualGrid {
|
|
5
|
+
constructor(nbCellWidth, cellWidth, cellHeight) {
|
|
6
|
+
this.nbCellWidth = nbCellWidth;
|
|
7
|
+
this.cellWidth = cellWidth;
|
|
8
|
+
this.cellHeight = cellHeight;
|
|
9
|
+
this.cells = new Map();
|
|
10
|
+
this.inverseCells = new Map();
|
|
11
|
+
}
|
|
12
|
+
zoom(nbCell) {
|
|
13
|
+
this.nbCellWidth = Math.ceil(this.nbCellWidth / nbCell);
|
|
14
|
+
this.cellWidth *= nbCell;
|
|
15
|
+
this.cellHeight *= nbCell;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
getCellIndex(x, y) {
|
|
19
|
+
return this.nbCellWidth * Math.floor(y / this.cellHeight) + Math.floor(x / this.cellWidth);
|
|
20
|
+
}
|
|
21
|
+
getCells(box, cb) {
|
|
22
|
+
const { minX, minY, maxX, maxY } = box;
|
|
23
|
+
const topLeft = this.getCellIndex(minX, minY);
|
|
24
|
+
const topRight = this.getCellIndex(maxX, minY);
|
|
25
|
+
const bottomLeft = this.getCellIndex(minX, maxY);
|
|
26
|
+
const nbLines = (bottomLeft - topLeft) / this.nbCellWidth + 1;
|
|
27
|
+
for (let j = 0; j < nbLines; j++) {
|
|
28
|
+
for (let i = topLeft; i <= topRight; i++) {
|
|
29
|
+
const index = i + (j * this.nbCellWidth);
|
|
30
|
+
cb(index);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
getObjectsByBox(box) {
|
|
35
|
+
let objects = [];
|
|
36
|
+
this.getCells(box, (index) => {
|
|
37
|
+
objects = [...objects, ...this.cells.get(index) || []];
|
|
38
|
+
});
|
|
39
|
+
return new Set(objects);
|
|
40
|
+
}
|
|
41
|
+
getObjectsById(id) {
|
|
42
|
+
let objects = [];
|
|
43
|
+
const cells = this.inverseCells.get(id);
|
|
44
|
+
cells === null || cells === void 0 ? void 0 : cells.forEach((index) => {
|
|
45
|
+
objects = [...objects, ...this.cells.get(index) || []];
|
|
46
|
+
});
|
|
47
|
+
return new Set(objects);
|
|
48
|
+
}
|
|
49
|
+
clearObjectInCells(id) {
|
|
50
|
+
var _a;
|
|
51
|
+
if (this.inverseCells.has(id)) {
|
|
52
|
+
(_a = this.inverseCells.get(id)) === null || _a === void 0 ? void 0 : _a.forEach((cellIndex) => {
|
|
53
|
+
var _a;
|
|
54
|
+
(_a = this.cells.get(cellIndex)) === null || _a === void 0 ? void 0 : _a.delete(id);
|
|
55
|
+
});
|
|
56
|
+
this.inverseCells.delete(id);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
insertInCells(id, box) {
|
|
60
|
+
this.clearObjectInCells(id);
|
|
61
|
+
const cells = new Set();
|
|
62
|
+
this.getCells(box, (index) => {
|
|
63
|
+
var _a;
|
|
64
|
+
cells.add(index);
|
|
65
|
+
const memoryCells = this.cells.get(index);
|
|
66
|
+
if (!memoryCells) {
|
|
67
|
+
this.cells.set(index, new Set());
|
|
68
|
+
}
|
|
69
|
+
(_a = this.cells.get(index)) === null || _a === void 0 ? void 0 : _a.add(id);
|
|
70
|
+
});
|
|
71
|
+
this.inverseCells.set(id, cells);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.VirtualGrid = VirtualGrid;
|
|
75
|
+
//# sourceMappingURL=VirtualGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualGrid.js","sourceRoot":"","sources":["../src/VirtualGrid.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IAIpB,YAAoB,WAAmB,EAAU,SAAiB,EAAU,UAAkB;QAA1E,gBAAW,GAAX,WAAW,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QAAU,eAAU,GAAV,UAAU,CAAQ;QAHtF,UAAK,GAA6B,IAAI,GAAG,EAAE,CAAA;QAC3C,iBAAY,GAA6B,IAAI,GAAG,EAAE,CAAA;IAEuC,CAAC;IAElG,IAAI,CAAC,MAAc;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;QACvD,IAAI,CAAC,SAAS,IAAI,MAAM,CAAA;QACxB,IAAI,CAAC,UAAU,IAAI,MAAM,CAAA;QACzB,OAAO,IAAI,CAAA;IACf,CAAC;IAED,YAAY,CAAC,CAAS,EAAE,CAAS;QAC7B,OAAO,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;IAC9F,CAAC;IAEO,QAAQ,CAAC,GAAQ,EAAE,EAA2B;QAClD,MAAM,EACF,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACP,GAAG,GAAG,CAAA;QACP,MAA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3ED,kCA2EC"}
|
package/lib/Worker.d.ts
ADDED
package/lib/Worker.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GameWorker = void 0;
|
|
7
|
+
const workerpool_1 = __importDefault(require("workerpool"));
|
|
8
|
+
class GameWorker {
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
this.options = options;
|
|
11
|
+
this.pool = workerpool_1.default.pool(__dirname + '/workers/move.js', options);
|
|
12
|
+
}
|
|
13
|
+
load() {
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
call(methodName, data) {
|
|
17
|
+
return this.pool.exec(methodName, [data]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.GameWorker = GameWorker;
|
|
21
|
+
//# sourceMappingURL=Worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Worker.js","sourceRoot":"","sources":["../src/Worker.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AAEnC,MAAa,UAAU;IAGnB,YAAoB,UAAU,EAAE;QAAZ,YAAO,GAAP,OAAO,CAAK;QAC5B,IAAI,CAAC,IAAI,GAAG,oBAAU,CAAC,IAAI,CAAC,SAAS,GAAG,kBAAkB,EAAE,OAAO,CAAC,CAAA;IACxE,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAA;IACf,CAAC;IAED,IAAI,CAAC,UAAkB,EAAE,IAAS;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5C,CAAC;CACJ;AAdD,gCAcC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Direction, RpgCommonPlayer, PlayerType } from './Player';
|
|
2
|
-
import RpgCommonEvent from './Event';
|
|
1
|
+
import { Direction, LiteralDirection, RpgCommonPlayer, PlayerType } from './Player';
|
|
2
|
+
import { RpgCommonEvent } from './Event';
|
|
3
3
|
import RpgCommonMap from './Map';
|
|
4
|
-
import RpgCommonGame from './Game';
|
|
4
|
+
import { RpgCommonGame, GameSide } from './Game';
|
|
5
5
|
import { EventEmitter } from './EventEmitter';
|
|
6
6
|
import { PrebuiltGui } from './gui/PrebuiltGui';
|
|
7
7
|
import Utils from './Utils';
|
|
@@ -14,4 +14,5 @@ import { RpgModule, loadModules, ModuleType } from './Module';
|
|
|
14
14
|
import * as MockIo from './transports/io';
|
|
15
15
|
import * as Logger from './Logger';
|
|
16
16
|
import { RpgShape, ShapePositioning } from './Shape';
|
|
17
|
-
|
|
17
|
+
import { VirtualGrid } from './VirtualGrid';
|
|
18
|
+
export { RpgCommonPlayer, RpgCommonEvent, RpgCommonMap, RpgCommonGame, EventEmitter, Utils, TransportIo, Direction, LiteralDirection, PrebuiltGui, PlayerType, Input, Control, MockIo, RpgPlugin, Plugin, HookServer, HookClient, Scheduler, Hit, RpgModule, loadModules, Logger, ModuleType, RpgShape, ShapePositioning, VirtualGrid, GameSide };
|
package/lib/index.js
CHANGED
|
@@ -22,17 +22,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ShapePositioning = exports.RpgShape = exports.Logger = exports.loadModules = exports.RpgModule = exports.Hit = exports.Scheduler = exports.HookClient = exports.HookServer = exports.RpgPlugin = exports.MockIo = exports.Control = exports.Input = exports.PlayerType = exports.PrebuiltGui = exports.Direction = exports.TransportIo = exports.Utils = exports.EventEmitter = exports.RpgCommonGame = exports.RpgCommonMap = exports.RpgCommonEvent = exports.RpgCommonPlayer = void 0;
|
|
25
|
+
exports.GameSide = exports.VirtualGrid = exports.ShapePositioning = exports.RpgShape = exports.Logger = exports.loadModules = exports.RpgModule = exports.Hit = exports.Scheduler = exports.HookClient = exports.HookServer = exports.RpgPlugin = exports.MockIo = exports.Control = exports.Input = exports.PlayerType = exports.PrebuiltGui = exports.LiteralDirection = exports.Direction = exports.TransportIo = exports.Utils = exports.EventEmitter = exports.RpgCommonGame = exports.RpgCommonMap = exports.RpgCommonEvent = exports.RpgCommonPlayer = void 0;
|
|
26
26
|
const Player_1 = require("./Player");
|
|
27
27
|
Object.defineProperty(exports, "Direction", { enumerable: true, get: function () { return Player_1.Direction; } });
|
|
28
|
+
Object.defineProperty(exports, "LiteralDirection", { enumerable: true, get: function () { return Player_1.LiteralDirection; } });
|
|
28
29
|
Object.defineProperty(exports, "RpgCommonPlayer", { enumerable: true, get: function () { return Player_1.RpgCommonPlayer; } });
|
|
29
30
|
Object.defineProperty(exports, "PlayerType", { enumerable: true, get: function () { return Player_1.PlayerType; } });
|
|
30
|
-
const Event_1 =
|
|
31
|
-
exports
|
|
31
|
+
const Event_1 = require("./Event");
|
|
32
|
+
Object.defineProperty(exports, "RpgCommonEvent", { enumerable: true, get: function () { return Event_1.RpgCommonEvent; } });
|
|
32
33
|
const Map_1 = __importDefault(require("./Map"));
|
|
33
34
|
exports.RpgCommonMap = Map_1.default;
|
|
34
|
-
const Game_1 =
|
|
35
|
-
exports
|
|
35
|
+
const Game_1 = require("./Game");
|
|
36
|
+
Object.defineProperty(exports, "RpgCommonGame", { enumerable: true, get: function () { return Game_1.RpgCommonGame; } });
|
|
37
|
+
Object.defineProperty(exports, "GameSide", { enumerable: true, get: function () { return Game_1.GameSide; } });
|
|
36
38
|
const EventEmitter_1 = require("./EventEmitter");
|
|
37
39
|
Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return EventEmitter_1.EventEmitter; } });
|
|
38
40
|
const PrebuiltGui_1 = require("./gui/PrebuiltGui");
|
|
@@ -62,4 +64,6 @@ exports.Logger = Logger;
|
|
|
62
64
|
const Shape_1 = require("./Shape");
|
|
63
65
|
Object.defineProperty(exports, "RpgShape", { enumerable: true, get: function () { return Shape_1.RpgShape; } });
|
|
64
66
|
Object.defineProperty(exports, "ShapePositioning", { enumerable: true, get: function () { return Shape_1.ShapePositioning; } });
|
|
67
|
+
const VirtualGrid_1 = require("./VirtualGrid");
|
|
68
|
+
Object.defineProperty(exports, "VirtualGrid", { enumerable: true, get: function () { return VirtualGrid_1.VirtualGrid; } });
|
|
65
69
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAmF;AA0B/E,0FA1BK,kBAAS,OA0BL;AACT,iGA3BgB,yBAAgB,OA2BhB;AARhB,gGAnBkC,wBAAe,OAmBlC;AAUf,2FA7BmD,mBAAU,OA6BnD;AA5Bd,mCAAuC;AAmBnC,+FAnBI,sBAAc,OAmBJ;AAlBlB,gDAAgC;AAmB5B,uBAnBG,aAAY,CAmBH;AAlBhB,iCAAgD;AAmB5C,8FAnBK,oBAAa,OAmBL;AAwBb,yFA3CoB,eAAQ,OA2CpB;AA1CZ,iDAA6C;AAmBzC,6FAnBK,2BAAY,OAmBL;AAlBhB,mDAA+C;AAuB3C,4FAvBK,yBAAW,OAuBL;AAtBf,oDAA2B;AAkBvB,gBAlBG,eAAK,CAkBH;AAjBT,qCAAoE;AA0BhE,0FA1BK,kBAAS,OA0BL;AAET,2FA5BwB,mBAAU,OA4BxB;AACV,2FA7BoC,mBAAU,OA6BpC;AA5Bd,6DAA8C;AAiB1C,kCAAW;AAhBf,mCAAwC;AAqBpC,sFArBK,aAAK,OAqBL;AACL,wFAtBY,eAAO,OAsBZ;AArBX,+BAA2B;AA4BvB,oFA5BK,SAAG,OA4BL;AA3BP,2CAAuC;AA0BnC,0FA1BK,qBAAS,OA0BL;AAzBb,qCAA6D;AA2BzD,0FA3BK,kBAAS,OA2BL;AACT,4FA5BgB,oBAAW,OA4BhB;AA3Bf,wDAAyC;AAmBrC,wBAAM;AAlBV,iDAAmC;AA2B/B,wBAAM;AA1BV,mCAAoD;AA4BhD,yFA5BK,gBAAQ,OA4BL;AACR,iGA7Be,wBAAgB,OA6Bf;AA5BpB,+CAA2C;AA6BvC,4FA7BK,yBAAW,OA6BL"}
|