예제 #1
0
        public void CanDeserializeColiFile()
        {
            var currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var coursePath = Path.Combine(currentDir, courseFile);

            using (var loader = new LZUnpacker(coursePath))
                using (var reader = new FZReader(loader.GetStream()))
                {
                    var file = ColiFile.Deserialize(reader);
                }
        }
예제 #2
0
        public static ColiFile Deserialize(FZReader reader)
        {
            var file = new ColiFile();

            file.header               = reader.ReadBytes(8);
            file.checkpointTable      = CheckpointTable.Deserialize(reader);
            file.unknownTable1        = UnknownTable1.Deserialize(reader);
            file.objectCollisionTable = ObjectCollisionTable.Deserialize(reader);
            file.unknown1             = reader.ReadInt32Array(12);
            file.objectTable          = ObjectTable.Deserialize(reader);
            file.unknown2             = reader.ReadInt32();
            file.unknown3             = reader.ReadInt32Array(2);
            file.meshCollisionTable   = MeshCollisionTable.Deserialize(reader);
            file.unknownTable2        = UnknownTable2.Deserialize(reader);
            file.unknown4             = reader.ReadInt32Array(4);
            file.unknownOffset1       = reader.ReadInt32();
            file.unknown5             = reader.ReadInt32Array(2);
            file.unknownOffset2       = reader.ReadInt32();
            file.unknownTable3        = UnknownTable3.Deserialize(reader);
            file.unknownTable4        = UnknownTable4.Deserialize(reader);
            file.unknown6             = reader.ReadInt32Array(23);

            return(file);
        }