diff --git a/src/util/Testbed.ts b/src/util/Testbed.ts index d134ccf1..347430da 100644 --- a/src/util/Testbed.ts +++ b/src/util/Testbed.ts @@ -20,10 +20,26 @@ export type ActiveKeys = { [key in KEY]?: boolean }; type TestbedMountOptions = {}; export abstract class Testbed { + /** + * Mount testbed. + * + * If you need to customize testbed before starting, use `Testbed.mount()` and `Testbed.start()` separately. + */ static mount(options?: TestbedMountOptions): Testbed { throw new Error('Not implemented'); } + /** + * Start simulation, and mount testbed if needed. + * + * If you need to customize testbed before starting, use `Testbed.mount().start()` separately. + */ + static start(world: World): Testbed { + const testbed = Testbed.mount(); + testbed.start(world); + return testbed; + } + /** World viewbox width. */ width: number = 80;