소스 검색

Store initial inputModeMap for resetting

When the computer is reset, the inputModeMap set at creation is loaded
back into the inputModeMap key.
ApisNecros 1 년 전
부모
커밋
731f5d732f
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      IntComp/Computer.js

+ 2 - 0
IntComp/Computer.js

@@ -56,6 +56,7 @@ module.exports = class Computer {
             inputFromConsole: options.inputFromConsole ?? false,
             outputToConsole: options.outputToConsole ?? false,
             inputModeMap: options.inputModeMap ?? [],
+            _initialInputModeMap: options.inputModeMap ?? [],
         };
 
         /**
@@ -413,6 +414,7 @@ module.exports = class Computer {
         this.stack = new Stack(this._initialMemory);
         this.outputValues = null;
         this.outputComputer = null;
+        this.options.inputModeMap = DeepClone(this.options._initialInputModeMap);
     }
 
     /**