public bool ClaimStoryFile(IStoryFile storyFile)
        {
            var sig = Encoding.ASCII.GetBytes(Signature);
            var magic = storyFile.ReadBytes(0, (uint)sig.Length);

            return sig.SequenceEqual(magic);
        }
Exemple #2
0
        private static UInt16 ReadZint(IStoryFile storyFile, uint offset)
        {
            var b0 = storyFile.ReadByte(offset);
            var b1 = storyFile.ReadByte(offset + 1);

            return((UInt16)((b0 << 8) | b1));
        }
        private static UInt16 ReadZint(IStoryFile storyFile, uint offset)
        {
            var b0 = storyFile.ReadByte(offset);
            var b1 = storyFile.ReadByte(offset + 1);

            return (UInt16)((b0 << 8) | b1);
        }
Exemple #4
0
        public bool ClaimStoryFile(IStoryFile storyFile)
        {
            var sig   = Encoding.ASCII.GetBytes(Signature);
            var magic = storyFile.ReadBytes(0, (uint)sig.Length);

            return(sig.SequenceEqual(magic));
        }
        public bool ClaimStoryFile(IStoryFile storyFile)
        {
            uint indexTemp;
            if (storyFile.Extent < 16 ||
                !storyFile.TryIndexOf("FORM", 0, 4, out indexTemp) ||
                !storyFile.TryIndexOf("IFRS", 8, 8 + 4, out indexTemp))
            {
                return false;
            }

            return true;
        }
Exemple #6
0
        public bool ClaimStoryFile(IStoryFile storyFile)
        {
            uint indexTemp;

            if (storyFile.Extent < 16 ||
                !storyFile.TryIndexOf("FORM", 0, 4, out indexTemp) ||
                !storyFile.TryIndexOf("IFRS", 8, 8 + 4, out indexTemp))
            {
                return(false);
            }

            return(true);
        }
Exemple #7
0
        public bool ClaimStoryFile(IStoryFile storyFile)
        {
            byte ver = storyFile.ReadByte(0);

            if (storyFile.Extent < 0x3c ||
                ver < 1 ||
                ver > 8)
            {
                return(false);
            }

            for (uint i = 4; i <= 14; i += 2)
            {
                var j = ReadZint(storyFile, i);
                if (j > storyFile.Extent || j < 0x40)
                {
                    return(false);
                }
            }

            return(true);
        }
        public bool ClaimStoryFile(IStoryFile storyFile)
        {
            byte ver = storyFile.ReadByte(0);

            if (storyFile.Extent < 0x3c ||
                ver < 1 ||
                ver > 8)
            {
                return false;
            }

            for (uint i = 4; i <= 14; i += 2)
            {
                var j = ReadZint(storyFile, i);
                if (j > storyFile.Extent || j < 0x40)
                {
                    return false;
                }
            }

            return true;
        }
 public GlulxHandler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
 }
Exemple #10
0
 public GlulxHandler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
 }
Exemple #11
0
 public IStoryFileHandler GetStoryFileHandler(IStoryFile storyFile)
 {
     return(new GlulxHandler(this, storyFile));
 }
 public TreatyStoryFileHandlerBase(ITreatyProvider provider, IStoryFile storyFile)
 {
     this.Provider = provider;
     this.StoryFile = storyFile;
 }
Exemple #13
0
 public Tads2Handler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
 }
Exemple #14
0
 public IStoryFileHandler GetStoryFileHandler(IStoryFile storyFile)
 {
     return(new Tads2Handler(this, storyFile));
 }
 public BlorbHandler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
     this.reader = new BlorbReader(storyFile.Stream, false);
 }
Exemple #16
0
 public TreatyStoryFileHandlerBase(ITreatyProvider provider, IStoryFile storyFile)
 {
     this.Provider  = provider;
     this.StoryFile = storyFile;
 }
Exemple #17
0
 public ZcodeHandler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
 }
 public IStoryFileHandler GetStoryFileHandler(IStoryFile storyFile)
 {
     return new BlorbHandler(this, storyFile);
 }
 public IStoryFileHandler GetStoryFileHandler(IStoryFile storyFile)
 {
     return new Tads2Handler(this, storyFile);
 }
 public ZcodeHandler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
 }
Exemple #21
0
 public IStoryFileHandler GetStoryFileHandler(IStoryFile storyFile)
 {
     return(new BlorbHandler(this, storyFile));
 }
Exemple #22
0
 public BlorbHandler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
     this.reader = new BlorbReader(storyFile.Stream, false);
 }
 public Tads2Handler(ITreatyProvider provider, IStoryFile storyFile)
     : base(provider, storyFile)
 {
 }
 public IStoryFileHandler GetStoryFileHandler(IStoryFile storyFile)
 {
     return new GlulxHandler(this, storyFile);
 }