@codehz/ecs 0.7.0 → 0.7.1
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/README.en.md +14 -8
- package/README.md +14 -8
- package/builder.d.mts +6 -0
- package/package.json +1 -1
- package/world.mjs.map +1 -1
package/README.en.md
CHANGED
|
@@ -204,8 +204,10 @@ world.sync();
|
|
|
204
204
|
### Running Examples
|
|
205
205
|
|
|
206
206
|
```bash
|
|
207
|
-
bun run examples/simple
|
|
208
|
-
bun run examples/advanced-scheduling
|
|
207
|
+
bun run examples/simple.ts
|
|
208
|
+
bun run examples/advanced-scheduling.ts
|
|
209
|
+
bun run examples/parent-child-hierarchy.ts
|
|
210
|
+
bun run examples/inventory-system-relations.ts
|
|
209
211
|
```
|
|
210
212
|
|
|
211
213
|
## API Overview
|
|
@@ -410,11 +412,14 @@ src/
|
|
|
410
412
|
└── __tests__/ # Unit tests & performance tests
|
|
411
413
|
|
|
412
414
|
examples/
|
|
413
|
-
├──
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
415
|
+
├── advanced-scheduling.ts # Pipeline scheduling example
|
|
416
|
+
├── collision-detection.ts # Collision detection example
|
|
417
|
+
├── parent-child-hierarchy.ts # Parent-child hierarchy and transform propagation example
|
|
418
|
+
├── serialization.ts # Serialization example
|
|
419
|
+
├── simple.ts # Basic example
|
|
420
|
+
├── spatial-grid.ts # Spatial grid example
|
|
421
|
+
├── state-machine.ts # State machine example
|
|
422
|
+
└── tag-filtering.ts # Tag filtering example
|
|
418
423
|
|
|
419
424
|
scripts/
|
|
420
425
|
├── build.ts # Build script
|
|
@@ -427,7 +432,8 @@ scripts/
|
|
|
427
432
|
bun install
|
|
428
433
|
bun test # Run tests
|
|
429
434
|
bunx tsc --noEmit # Type check
|
|
430
|
-
bun run examples/simple
|
|
435
|
+
bun run examples/simple.ts # Run example
|
|
436
|
+
bun run examples/parent-child-hierarchy.ts
|
|
431
437
|
bun run scripts/build.ts # Build
|
|
432
438
|
```
|
|
433
439
|
|
package/README.md
CHANGED
|
@@ -204,8 +204,10 @@ world.sync();
|
|
|
204
204
|
### 运行示例
|
|
205
205
|
|
|
206
206
|
```bash
|
|
207
|
-
bun run examples/simple
|
|
208
|
-
bun run examples/advanced-scheduling
|
|
207
|
+
bun run examples/simple.ts
|
|
208
|
+
bun run examples/advanced-scheduling.ts
|
|
209
|
+
bun run examples/parent-child-hierarchy.ts
|
|
210
|
+
bun run examples/inventory-system-relations.ts
|
|
209
211
|
```
|
|
210
212
|
|
|
211
213
|
## API 概述
|
|
@@ -410,11 +412,14 @@ src/
|
|
|
410
412
|
└── __tests__/ # 单元测试 & 性能测试
|
|
411
413
|
|
|
412
414
|
examples/
|
|
413
|
-
├──
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
415
|
+
├── advanced-scheduling.ts # Pipeline 调度示例
|
|
416
|
+
├── collision-detection.ts # 碰撞检测示例
|
|
417
|
+
├── parent-child-hierarchy.ts # 父子层级与 Transform 传播示例
|
|
418
|
+
├── serialization.ts # 序列化示例
|
|
419
|
+
├── simple.ts # 基本示例
|
|
420
|
+
├── spatial-grid.ts # 空间网格示例
|
|
421
|
+
├── state-machine.ts # 状态机示例
|
|
422
|
+
└── tag-filtering.ts # 标签过滤示例
|
|
418
423
|
|
|
419
424
|
scripts/
|
|
420
425
|
├── build.ts # 构建脚本
|
|
@@ -427,7 +432,8 @@ scripts/
|
|
|
427
432
|
bun install
|
|
428
433
|
bun test # 运行测试
|
|
429
434
|
bunx tsc --noEmit # 类型检查
|
|
430
|
-
bun run examples/simple
|
|
435
|
+
bun run examples/simple.ts # 运行示例
|
|
436
|
+
bun run examples/parent-child-hierarchy.ts
|
|
431
437
|
bun run scripts/build.ts # 构建
|
|
432
438
|
```
|
|
433
439
|
|
package/builder.d.mts
CHANGED
|
@@ -1070,6 +1070,9 @@ declare class World {
|
|
|
1070
1070
|
* @overload getOptional<T>(entityId: EntityId<T>): { value: T } | undefined
|
|
1071
1071
|
* Retrieves the entity's primary component safely.
|
|
1072
1072
|
*
|
|
1073
|
+
* @overload getOptional<T>(entityId: EntityId, componentType: WildcardRelationId<T>): { value: [EntityId<unknown>, T][] } | undefined
|
|
1074
|
+
* Retrieves all matching relation values safely.
|
|
1075
|
+
*
|
|
1073
1076
|
* @overload getOptional<T>(entityId: EntityId, componentType: EntityId<T>): { value: T } | undefined
|
|
1074
1077
|
* Retrieves a specific component safely.
|
|
1075
1078
|
*
|
|
@@ -1084,6 +1087,9 @@ declare class World {
|
|
|
1084
1087
|
getOptional<T>(entityId: EntityId<T>): {
|
|
1085
1088
|
value: T;
|
|
1086
1089
|
} | undefined;
|
|
1090
|
+
getOptional<T>(entityId: EntityId, componentType: WildcardRelationId<T>): {
|
|
1091
|
+
value: [EntityId<unknown>, T][];
|
|
1092
|
+
} | undefined;
|
|
1087
1093
|
getOptional<T>(entityId: EntityId, componentType: EntityId<T>): {
|
|
1088
1094
|
value: T;
|
|
1089
1095
|
} | undefined;
|