Esempio n. 1
0
        public ScriptFormula(MpqFileStream stream)
        {
            this.I0 = stream.ReadValueS32();
            this.I1 = stream.ReadValueS32();
            this.I2 = stream.ReadValueS32();
            this.I3 = stream.ReadValueS32();
            this.I4 = stream.ReadValueS32();
            this.NameSize = stream.ReadValueS32();
            this.I5 = stream.ReadValueS32();
            this.OpcodeSize = stream.ReadValueS32();
            this.OpCodeName = stream.ReadStringZ(Encoding.ASCII);
 
            switch(NameSize % 4)
            {
                case 0:
                    break;
                case 1:
                    stream.Position += 3;
                    break;
                case 2:
                    stream.Position += 2;
                    break;
                case 3:
                    stream.Position += 1;
                    break;

            }
            this.OpCodeArray = new byte[OpcodeSize];
            stream.Read(OpCodeArray, 0, OpcodeSize);
        }