public FilterBase(IZMachineIO next) { if (next == null) throw new ArgumentNullException("primary"); this.next = next; }
public TeeFilter(IZMachineIO next, IZMachineIO side) : base(next) { if (side == null) throw new ArgumentNullException("side"); this.side = side; }
public FilterBase(IZMachineIO next) { if (next == null) { throw new ArgumentNullException("primary"); } this.next = next; }
public TeeFilter(IZMachineIO next, IZMachineIO side) : base(next) { if (side == null) { throw new ArgumentNullException("side"); } this.side = side; }
/// <summary> /// Initializes a new instance of the ZLR engine from a given stream. /// The stream must remain open while the engine is in use. /// </summary> /// <param name="gameStream">A stream containing either a plain Z-code /// file or a Blorb file which in turn contains a Z-code resource.</param> /// <param name="io"></param> public ZMachine(Stream gameStream, IZMachineIO io) { if (gameStream == null) { throw new ArgumentNullException("gameStream"); } if (io == null) { throw new ArgumentNullException("io"); } this.io = io; // check for Blorb byte[] temp = new byte[12]; gameStream.Seek(0, SeekOrigin.Begin); gameStream.Read(temp, 0, 12); if (temp[0] == 'F' && temp[1] == 'O' && temp[2] == 'R' && temp[3] == 'M' && temp[8] == 'I' && temp[9] == 'F' && temp[10] == 'R' && temp[11] == 'S') { Blorb blorb = new Blorb(gameStream); if (blorb.GetStoryType() == "ZCOD") { gameStream = blorb.GetStoryStream(); } else { throw new ArgumentException("Not a Z-code Blorb"); } } this.gameFile = gameStream; zmem = new byte[gameStream.Length]; gameStream.Seek(0, SeekOrigin.Begin); gameStream.Read(zmem, 0, (int)gameStream.Length); if (zmem.Length < 64) { throw new ArgumentException("Z-code file is too short: must be at least 64 bytes"); } zversion = zmem[0]; if (zversion != 5 && zversion != 8) { throw new ArgumentException("Z-code version must be 5 or 8"); } io.SizeChanged += new EventHandler(io_SizeChanged); }
public InternalSaveFilter(IZMachineIO next) : base(next) { }
public NoFilesFilter(IZMachineIO next) : base(next) { }
public NoSoundFilter(IZMachineIO next) : base(next) { }
public DebuggingConsole(ZMachine zm, IZMachineIO io, string[] sourcePath) { this.zm = zm; this.io = io; this.sourcePath = sourcePath; }
/// <summary> /// Initializes a new instance of the ZLR engine from a given stream. /// The stream must remain open while the engine is in use. /// </summary> /// <param name="gameStream">A stream containing either a plain Z-code /// file or a Blorb file which in turn contains a Z-code resource.</param> /// <param name="io"></param> public ZMachine(Stream gameStream, IZMachineIO io) { if (gameStream == null) throw new ArgumentNullException("gameStream"); if (io == null) throw new ArgumentNullException("io"); this.io = io; // check for Blorb byte[] temp = new byte[12]; gameStream.Seek(0, SeekOrigin.Begin); gameStream.Read(temp, 0, 12); if (temp[0] == 'F' && temp[1] == 'O' && temp[2] == 'R' && temp[3] == 'M' && temp[8] == 'I' && temp[9] == 'F' && temp[10] == 'R' && temp[11] == 'S') { Blorb blorb = new Blorb(gameStream); if (blorb.GetStoryType() == "ZCOD") gameStream = blorb.GetStoryStream(); else throw new ArgumentException("Not a Z-code Blorb"); } this.gameFile = gameStream; zmem = new byte[gameStream.Length]; gameStream.Seek(0, SeekOrigin.Begin); gameStream.Read(zmem, 0, (int)gameStream.Length); if (zmem.Length < 64) throw new ArgumentException("Z-code file is too short: must be at least 64 bytes"); zversion = zmem[0]; if (zversion < 1 || zversion > 8) throw new ArgumentException("Z-code version must be between 1 and 8"); io.SizeChanged += new EventHandler(io_SizeChanged); }