瀏覽代碼

Moved debug printing option to an object

To better differentiate between class options and class functions, I've
moved the flag for printing debug info into an object.
ApisNecros 1 年之前
父節點
當前提交
93d01a69e5
共有 1 個文件被更改,包括 9 次插入4 次删除
  1. 9 4
      starfish.js

+ 9 - 4
starfish.js

@@ -85,11 +85,16 @@ class CodeBox {
          */
         this.datetime = null;
         /**
-         * Should the code box be printed?
+         * Assorted debug options
          *
-         * @type {boolean}
+         * @type {object}
          */
-        this.print = false;
+        this.debug= {
+            print: {
+                codeBox: false,
+                stacks: false,
+            }
+        };
 
         this.codeBoxDOM = document.getElementById(codeBoxID);
         if(!this.codeBoxDOM) {
@@ -452,7 +457,7 @@ class CodeBox {
     }
 
     Swim() {
-        if(this.print) { this.PrintCodeBox(); }
+        if(this.debug.print.codeBox) { this.PrintCodeBox(); }
 
         const instruction = this.box[this.pointer.Y][this.pointer.X];
         this.datetime = new Date();