Skip to content

Commit b00f672

Browse files
committed
chore(example): update example with the new registry name
1 parent 45ec899 commit b00f672

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

example/pong/src/collisions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { type ECSRegistry } from "@nanoforge/ecs";
1+
import { type Registry } from "@nanoforge/ecs";
22

33
import { Hitbox, Position } from "./components";
44

5-
export function checkCollisions(registry: ECSRegistry, entity: any) {
5+
export function checkCollisions(registry: Registry, entity: any) {
66
const entities = registry.getZipper([Hitbox, Position]);
77

88
const { x, y } = entity.Position;

example/pong/src/systems.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type Context } from "@nanoforge/common";
2-
import { type ECSRegistry } from "@nanoforge/ecs";
2+
import { type Registry } from "@nanoforge/ecs";
33
import { type InputLibrary } from "@nanoforge/input";
44
import { type SoundLibrary } from "@nanoforge/sound";
55

@@ -14,7 +14,7 @@ import {
1414
Velocity,
1515
} from "./components";
1616

17-
export function move(registry: ECSRegistry) {
17+
export function move(registry: Registry) {
1818
const entities = registry.getZipper([Bounce, Position, Velocity]);
1919

2020
entities.forEach((entity) => {
@@ -23,7 +23,7 @@ export function move(registry: ECSRegistry) {
2323
});
2424
}
2525

26-
export function bounce(registry: ECSRegistry, ctx: Context) {
26+
export function bounce(registry: Registry, ctx: Context) {
2727
const entities = registry.getZipper([Bounce, Position, Velocity]);
2828

2929
entities.forEach((entity) => {
@@ -39,7 +39,7 @@ export function bounce(registry: ECSRegistry, ctx: Context) {
3939
});
4040
}
4141

42-
export function controlPlayer(registry: ECSRegistry, ctx: Context) {
42+
export function controlPlayer(registry: Registry, ctx: Context) {
4343
const entities = registry.getZipper([Controller, Position, Hitbox, Velocity]);
4444

4545
entities.forEach((entity) => {
@@ -62,7 +62,7 @@ export function controlPlayer(registry: ECSRegistry, ctx: Context) {
6262
});
6363
}
6464

65-
export function drawCircle(registry: ECSRegistry) {
65+
export function drawCircle(registry: Registry) {
6666
const entities = registry.getZipper([CircleComponent, Position]);
6767

6868
entities.forEach((entity) => {
@@ -71,7 +71,7 @@ export function drawCircle(registry: ECSRegistry) {
7171
});
7272
}
7373

74-
export function moveRectangle(registry: ECSRegistry) {
74+
export function moveRectangle(registry: Registry) {
7575
const entities = registry.getZipper([RectangleComponent, Position, Hitbox]);
7676

7777
entities.forEach((entity) => {

0 commit comments

Comments
 (0)