debugable wip
This commit is contained in:
parent
9500f6dabf
commit
5a5e490aa5
@ -3,12 +3,14 @@ import { TrackSegment } from "../track/system.ts";
|
|||||||
import { Train, TrainCar } from "../train/train.ts";
|
import { Train, TrainCar } from "../train/train.ts";
|
||||||
import { InputManager } from "./input.ts";
|
import { InputManager } from "./input.ts";
|
||||||
import { ResourceManager } from "./resources.ts";
|
import { ResourceManager } from "./resources.ts";
|
||||||
|
import { Debuggable } from "./debuggable.ts";
|
||||||
|
|
||||||
interface ContextMap {
|
interface ContextMap {
|
||||||
inputManager: InputManager;
|
inputManager: InputManager;
|
||||||
doodler: ZoomableDoodler;
|
doodler: ZoomableDoodler;
|
||||||
resources: ResourceManager;
|
resources: ResourceManager;
|
||||||
debug: Debug;
|
debug: Debug;
|
||||||
|
debuggables: Debuggable[];
|
||||||
colors: [
|
colors: [
|
||||||
string,
|
string,
|
||||||
string,
|
string,
|
||||||
|
@ -12,22 +12,24 @@ export abstract class Debuggable extends Drawable {
|
|||||||
if (typeof debugKeys[0] === "boolean") {
|
if (typeof debugKeys[0] === "boolean") {
|
||||||
drawFirst = debugKeys.shift() as boolean;
|
drawFirst = debugKeys.shift() as boolean;
|
||||||
}
|
}
|
||||||
const draw = this.draw.bind(this);
|
const debuggables = getContextItem("debuggables");
|
||||||
this.draw = drawFirst
|
debuggables.push(this);
|
||||||
? (...args: unknown[]) => {
|
// const draw = this.draw.bind(this);
|
||||||
draw(...args);
|
// this.draw = drawFirst
|
||||||
const debug = getContextItem<Debug>("debug");
|
// ? (...args: unknown[]) => {
|
||||||
if (debugKeys.some((k) => debug[k as keyof Debug])) {
|
// draw(...args);
|
||||||
this.debugDraw();
|
// const debug = getContextItem<Debug>("debug");
|
||||||
}
|
// if (debugKeys.some((k) => debug[k as keyof Debug])) {
|
||||||
}
|
// this.debugDraw();
|
||||||
: (...args: unknown[]) => {
|
// }
|
||||||
const debug = getContextItem<Debug>("debug");
|
// }
|
||||||
if (debugKeys.some((k) => debug[k as keyof Debug])) {
|
// : (...args: unknown[]) => {
|
||||||
this.debugDraw();
|
// const debug = getContextItem<Debug>("debug");
|
||||||
}
|
// if (debugKeys.some((k) => debug[k as keyof Debug])) {
|
||||||
draw(...args);
|
// this.debugDraw();
|
||||||
};
|
// }
|
||||||
|
// draw(...args);
|
||||||
|
// };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user