@awesome-ecs/abstract 0.5.2 → 0.5.5
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/LICENSE.md +201 -0
- package/README.md +99 -99
- package/dist/components/component.d.ts +17 -17
- package/dist/components/component.js +2 -2
- package/dist/components/identity-component.d.ts +19 -25
- package/dist/components/identity-component.js +7 -7
- package/dist/components/identity-component.js.map +1 -1
- package/dist/entities/{entity-event.d.ts → entity-events.d.ts} +37 -27
- package/dist/entities/{entity-event.js → entity-events.js} +3 -3
- package/dist/entities/entity-events.js.map +1 -0
- package/dist/entities/entity-proxy.d.ts +14 -14
- package/dist/entities/entity-proxy.js +2 -2
- package/dist/entities/entity-queue.d.ts +30 -30
- package/dist/entities/entity-queue.js +11 -11
- package/dist/entities/entity-repository.d.ts +23 -23
- package/dist/entities/entity-repository.js +2 -2
- package/dist/entities/entity-scheduler.d.ts +11 -10
- package/dist/entities/entity-scheduler.js +2 -2
- package/dist/entities/entity.d.ts +17 -17
- package/dist/entities/entity.js +2 -2
- package/dist/index.d.ts +16 -16
- package/dist/index.js +32 -32
- package/dist/index.js.map +1 -1
- package/dist/pipelines/middleware.d.ts +26 -26
- package/dist/pipelines/middleware.js +2 -2
- package/dist/pipelines/pipeline.d.ts +18 -18
- package/dist/pipelines/pipeline.js +2 -2
- package/dist/systems/system-middleware.d.ts +8 -8
- package/dist/systems/system-middleware.js +2 -2
- package/dist/systems/system-pipeline-context.d.ts +39 -38
- package/dist/systems/system-pipeline-context.js +2 -2
- package/dist/systems/system-pipeline-type.d.ts +6 -6
- package/dist/systems/system-pipeline-type.js +10 -10
- package/dist/systems/systems-module.d.ts +21 -21
- package/dist/systems/systems-module.js +2 -2
- package/dist/systems/systems-runtime.d.ts +26 -21
- package/dist/systems/systems-runtime.js +2 -2
- package/dist/utils/performance-timer.d.ts +10 -10
- package/dist/utils/performance-timer.js +2 -2
- package/package.json +5 -5
- package/LICENSE +0 -21
- package/dist/entities/entity-event.js.map +0 -1
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import { EntityTypeUid } from "../entities/entity";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { EntityTypeUid } from "../entities/entity";
|
|
2
|
+
import { PerformanceTimeEntry } from "../utils/performance-timer";
|
|
3
|
+
import { ISystemsModule } from "./systems-module";
|
|
4
|
+
export interface ISystemsRuntimeTickResult {
|
|
5
|
+
readonly remainingUpdatesCount: number;
|
|
6
|
+
readonly metrics?: PerformanceTimeEntry[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The System Runtime allows running a loop of Ticks.
|
|
10
|
+
*
|
|
11
|
+
* Each RunTick can process one or more Entity Updates, from the EntityQueue.
|
|
12
|
+
* We can have multiple implementations of a SystemRuntime, based on the use-case.
|
|
13
|
+
* A different implementation can be chosen at runtime, based for example on performance.
|
|
14
|
+
*/
|
|
15
|
+
export interface ISystemsRuntime {
|
|
16
|
+
/**
|
|
17
|
+
* Allows registering the SystemsModule that will be triggered for any EntityUpdate for the given EntityType.
|
|
18
|
+
* @param entityType The EntityType this module will be registered for.
|
|
19
|
+
* @param module The Module implementation that will be triggered when executing updates for the given EntityType.
|
|
20
|
+
*/
|
|
21
|
+
registerModule(entityType: EntityTypeUid, module: ISystemsModule): void;
|
|
22
|
+
/**
|
|
23
|
+
* The method allows for an Unit of Work implementation, and returns the remaining quantity of items scheduled to be processed next.
|
|
24
|
+
*/
|
|
25
|
+
runTick(): ISystemsRuntimeTickResult;
|
|
26
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=systems-runtime.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare type PerformanceTimerUid = number;
|
|
2
|
-
export interface PerformanceTimeEntry {
|
|
3
|
-
startedAt: number;
|
|
4
|
-
endedAt?: number;
|
|
5
|
-
msPassed?: number;
|
|
6
|
-
}
|
|
7
|
-
export interface IPerformanceTimer {
|
|
8
|
-
startTimer(name
|
|
9
|
-
endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
|
|
10
|
-
}
|
|
1
|
+
export declare type PerformanceTimerUid = number;
|
|
2
|
+
export interface PerformanceTimeEntry {
|
|
3
|
+
startedAt: number;
|
|
4
|
+
endedAt?: number;
|
|
5
|
+
msPassed?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface IPerformanceTimer {
|
|
8
|
+
startTimer(name?: string): PerformanceTimerUid;
|
|
9
|
+
endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
|
|
10
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=performance-timer.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesome-ecs/abstract",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "A comprehensive Entity-Component-System (ECS) Architecture implementation. Abstract components.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typescript": "^4.7.4"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "
|
|
14
|
+
"build": "rimraf ./dist && npx tsc --build"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"runtime",
|
|
27
27
|
"abstract"
|
|
28
28
|
],
|
|
29
|
-
"author": "
|
|
30
|
-
"license": "
|
|
29
|
+
"author": "privatebytes",
|
|
30
|
+
"license": "Apache-2.0",
|
|
31
31
|
"bugs": {
|
|
32
32
|
"url": "https://github.com/andreicojocaru/awesome-ecs/issues"
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/andreicojocaru/awesome-ecs#readme",
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "03a36e0b5e8af333f3922e331cbacadda408f0cc"
|
|
36
36
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Andrei C
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-event.js","sourceRoot":"","sources":["../../src/entities/entity-event.ts"],"names":[],"mappings":""}
|