Ejemplo n.º 1
0
        public void LoadFrom(Stream stream)
        {
            if (file.Types == null)
            {
                throw new Exception("No Types in file");
            }
            AssetCabinet.TypeDefinition typeDef = file.Types.Find
                                                  (
                delegate(AssetCabinet.TypeDefinition def)
            {
                return(def.typeId == (int)this.classID());
            }
                                                  );
            if (typeDef.definitions == null)
            {
                throw new Exception("Type definition is incomplete");
            }
            parser = new TypeParser(file, typeDef);

            parser.type.LoadFrom(stream);
        }
Ejemplo n.º 2
0
        public void LoadFrom(Stream stream)
        {
            for (int i = 0; i < file.Types.Count; i++)
            {
                if ((int)classID1 == file.Types[i].typeId)
                {
                    Parser = new TypeParser(file, file.Types[i]);
                    Parser.type.LoadFrom(stream);
                    return;
                }
            }

            throw new Exception(classID2 + " " + classID1 + " not found in Types");
        }