@tdurtschi/bug
Version:
Bug is a simulation that models a weevil walking around in an HTML canvas.
24 lines (23 loc) • 793 B
TypeScript
import Entity, { EntityState } from "../entity";
import Victor from "victor";
import { ITreeStruct } from "./ITreeStruct";
export interface PlantState extends EntityState {
graph: ITreeStruct;
}
interface PlantStateInternal extends PlantState {
graph: ITreeStruct;
}
export declare function defaultState(): Partial<PlantState>;
export default abstract class Plant implements Entity, PlantState {
graph: ITreeStruct;
pos: Victor;
size: Victor;
id: number;
state: PlantStateInternal;
updateSpeed: number;
constructor(id?: number, initialState?: Partial<PlantState>);
getAbsolutePos: (node: ITreeStruct, accumulator?: Victor, rootNode?: ITreeStruct) => Victor;
abstract update(): void;
protected abstract generateGraph(): ITreeStruct;
}
export {};