Skip to content

Commit

Permalink
refactor(ecs): update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Sep 6, 2020
1 parent b09f1a6 commit 35f5289
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 21 deletions.
12 changes: 9 additions & 3 deletions packages/ecs/src/components/acomponent.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { INotifyMixin } from "@thi.ng/api";
import {
Event,
IID,
INotify,
INotifyMixin,
Listener,
UIntArray,
} from "@thi.ng/api";
import { isFunction } from "@thi.ng/checks";
import { EVENT_ADDED, EVENT_CHANGED, EVENT_PRE_DELETE } from "../constants";
import type { Event, IID, INotify, Listener, UIntArray } from "@thi.ng/api";
import type { ComponentDefaultValue, IComponent } from "../api";
import { EVENT_ADDED, EVENT_CHANGED, EVENT_PRE_DELETE } from "../constants";

@INotifyMixin
export abstract class AComponent<K extends string, VALUES, GET, SET>
Expand Down
13 changes: 10 additions & 3 deletions packages/ecs/src/components/mem-component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { assert, INotifyMixin, Type, typedArray, uintType } from "@thi.ng/api";
import { AComponent } from "./acomponent";
import type { TypedArray, UIntArray } from "@thi.ng/api";
import {
assert,
INotifyMixin,
Type,
typedArray,
TypedArray,
UIntArray,
uintType,
} from "@thi.ng/api";
import type { ICache, MemMappedComponentOpts } from "../api";
import { AComponent } from "./acomponent";

@INotifyMixin
export class MemMappedComponent<K extends string> extends AComponent<
Expand Down
11 changes: 8 additions & 3 deletions packages/ecs/src/components/object-component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { assert, INotifyMixin, typedArray, uintType } from "@thi.ng/api";
import { AComponent } from "./acomponent";
import type { UIntArray } from "@thi.ng/api";
import {
assert,
INotifyMixin,
typedArray,
UIntArray,
uintType,
} from "@thi.ng/api";
import type { ObjectComponentOpts } from "../api";
import { AComponent } from "./acomponent";

@INotifyMixin
export class ObjectComponent<K extends string, T> extends AComponent<
Expand Down
11 changes: 9 additions & 2 deletions packages/ecs/src/ecs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { assert, INotifyMixin, typedArray, uintType } from "@thi.ng/api";
import {
assert,
Event,
INotify,
INotifyMixin,
Listener,
typedArray,
uintType,
} from "@thi.ng/api";
import { bitSize } from "@thi.ng/binary";
import { isArray, isString } from "@thi.ng/checks";
import { IDGen } from "@thi.ng/idgen";
Expand All @@ -14,7 +22,6 @@ import { MemMappedComponent } from "./components/mem-component";
import { ObjectComponent } from "./components/object-component";
import { EVENT_ADDED, EVENT_PRE_DELETE } from "./constants";
import { Group } from "./groups/group";
import type { Event, INotify, Listener } from "@thi.ng/api";

let NEXT_GROUP_ID = 0;

Expand Down
19 changes: 9 additions & 10 deletions packages/ecs/src/groups/group.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { assert } from "@thi.ng/api";
import { assert, Event, FnO2, FnO3, IID } from "@thi.ng/api";
import { intersectionR } from "@thi.ng/associative";
import { map, transduce } from "@thi.ng/transducers";
import { UnboundedCache } from "../caches/unbounded";
import { ObjectComponent } from "../components/object-component";
import {
EVENT_ADDED,
EVENT_CHANGED,
EVENT_PRE_DELETE,
LOGGER,
} from "../constants";
import type { Event, FnO2, FnO3, IID } from "@thi.ng/api";
import type {
ComponentID,
GroupInfo,
Expand All @@ -18,6 +9,14 @@ import type {
ICache,
IComponent,
} from "../api";
import { UnboundedCache } from "../caches/unbounded";
import { ObjectComponent } from "../components/object-component";
import {
EVENT_ADDED,
EVENT_CHANGED,
EVENT_PRE_DELETE,
LOGGER,
} from "../constants";

export class Group<SPEC, K extends ComponentID<SPEC>> implements IID<string> {
readonly id: string;
Expand Down

0 comments on commit 35f5289

Please sign in to comment.