migrating instruction generation logic to pxt

This commit is contained in:
Peli de Halleux
2016-09-26 13:26:43 -07:00
parent a114dc32e7
commit 5edd06c9b9
3 changed files with 41 additions and 632 deletions

View File

@ -1,19 +1,10 @@
namespace pxsim.visuals {
export function mkBoardView(opts: BoardHostOpts): BoardView {
if (opts.boardDef.visual === "microbit") {
return new visuals.MicrobitBoardSvg({
runtime: runtime,
theme: visuals.randomTheme(),
disableTilt: false,
wireframe: opts.wireframe,
});
} else {
let boardVis = opts.boardDef.visual as BoardImageDefinition;
return new visuals.GenericBoardSvg({
visualDef: boardVis,
wireframe: opts.wireframe,
});
}
mkBoardView = (opts: BoardViewOptions): BoardView => {
return new visuals.MicrobitBoardSvg({
runtime: runtime,
theme: visuals.randomTheme(),
disableTilt: false,
wireframe: opts.wireframe,
});
}
}