@polyzone/core
Version:
PolyZone core API
29 lines (28 loc) • 1.28 kB
TypeScript
import { ClassReference } from "../../util";
import { GameObjectComponent, Transform } from "../../world";
import { GameObject } from "../../world/GameObject";
import { WorldModule } from './WorldModule';
export interface IQueryResult<TResult> {
get result(): TResult;
}
export declare class QueryUtils {
static getPathSegments(pathString: string): string[];
static resolvePath(path: string, initialTransformList: Transform[], initialTransform: Transform | undefined): Transform;
}
export declare class WorldQuery {
private world;
constructor(world: WorldModule);
path(pathString: string): GameObjectQuery;
}
export declare class GameObjectQuery implements IQueryResult<GameObject> {
private gameObject;
constructor(gameObject: GameObject);
path(pathString: string): GameObjectQuery;
component<TGameObjectComponent extends GameObjectComponent>(componentCtor: ClassReference<TGameObjectComponent>): GameObjectComponentQuery<TGameObjectComponent>;
get result(): GameObject;
}
export declare class GameObjectComponentQuery<TGameObjectComponent extends GameObjectComponent> implements IQueryResult<TGameObjectComponent> {
private component;
constructor(component: TGameObjectComponent);
get result(): TGameObjectComponent;
}