public static ClockworkZMachine Create(byte[] storyBytes, IEnumerable<string> commands)
        {
            var ret = new ClockworkZMachine();
            ret.Load(storyBytes);

            foreach (var command in commands) ret.Process(command);

            return ret;
        }
        public static ClockworkZMachine Load(BinaryReader reader)
        {
            var virtualMachine = new ClockworkZMachine();
            virtualMachine.z_processor = ClockworkZProcessor.Load(reader);

            virtualMachine.z_io = virtualMachine.z_processor.IO;
            virtualMachine.z_io.Screen = new ZMachine.v3.V3Screen(virtualMachine.z_processor as ZProcessor);

            virtualMachine.z_io.Screen.UpperWindow = new NullWindow();
            virtualMachine.z_io.Screen.LowerWindow = virtualMachine.Window;
            virtualMachine.z_io.Reset();
            virtualMachine.z_io.Keyboard = new ClockworkKeyboard();

            return virtualMachine;
        }
Exemple #3
0
 protected Game(ClockworkZMachine virtualMachine, string message)
     : this(virtualMachine)
 {
     _virtualMachine.Process(message);
 }
Exemple #4
0
 protected Game(ClockworkZMachine virtualMachine)
 {
     _virtualMachine = virtualMachine;
     _virtualMachine.Window.PrintCompleted += OnPrintCompleted;
 }