The split ident.
Inheritance: HaloMap.Meta.Meta.Ident
Beispiel #1
0
        /// <summary>
        /// The recursively add pieces to meta.
        /// </summary>
        /// <param name="reflex">The reflex.</param>
        /// <param name="destination">The destination.</param>
        /// <param name="BW">The bw.</param>
        /// <remarks></remarks>
        public static void RecursivelyAddPiecesToMeta(
            MetaSplitter.SplitReflexive reflex, ref List <Meta.Item> destination, ref BinaryWriter BW)
        {
            for (int x = 0; x < reflex.Chunks.Count; x++)
            {
                BW.BaseStream.Position = reflex.translation + (reflex.chunksize * x);
                BW.Write(reflex.Chunks[x].MS.ToArray(), 0, reflex.chunksize);
                for (int y = 0; y < reflex.Chunks[x].ChunkResources.Count; y++)
                {
                    Meta.Item i = reflex.Chunks[x].ChunkResources[y];

                    switch (i.type)
                    {
                    case Meta.ItemType.Reflexive:
                        MetaSplitter.SplitReflexive treflex = (MetaSplitter.SplitReflexive)i;
                        treflex.offset += reflex.translation + (reflex.chunksize * x);

                        treflex.translation = metasize;
                        treflex.chunkcount  = treflex.Chunks.Count;

                        metasize                += treflex.chunksize * treflex.chunkcount;
                        treflex.type             = Meta.ItemType.Reflexive;
                        treflex.intag            = TagIndex;
                        treflex.pointstoTagIndex = TagIndex;
                        destination.Add(treflex);
                        RecursivelyAddPiecesToMeta(treflex, ref destination, ref BW);
                        break;

                    case Meta.ItemType.Ident:
                        MetaSplitter.SplitIdent id = new MetaSplitter.SplitIdent((MetaSplitter.SplitIdent)i);
                        id.offset += reflex.translation + (reflex.chunksize * x);
                        id.intag   = TagIndex;
                        destination.Add(id);

                        break;

                    case Meta.ItemType.String:
                        MetaSplitter.SplitString ss = (MetaSplitter.SplitString)i;
                        ss.offset += reflex.translation + (reflex.chunksize * x);
                        ss.intag   = TagIndex;
                        destination.Add(ss);
                        break;
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// The recursively add pieces to meta.
        /// </summary>
        /// <param name="reflex">The reflex.</param>
        /// <param name="destination">The destination.</param>
        /// <param name="BW">The bw.</param>
        /// <remarks></remarks>
        public static void RecursivelyAddPiecesToMeta(
            MetaSplitter.SplitReflexive reflex, ref List<Meta.Item> destination, ref BinaryWriter BW)
        {
            for (int x = 0; x < reflex.Chunks.Count; x++)
            {
                BW.BaseStream.Position = reflex.translation + (reflex.chunksize * x);
                BW.Write(reflex.Chunks[x].MS.ToArray(), 0, reflex.chunksize);
                for (int y = 0; y < reflex.Chunks[x].ChunkResources.Count; y++)
                {
                    Meta.Item i = reflex.Chunks[x].ChunkResources[y];

                    switch (i.type)
                    {
                        case Meta.ItemType.Reflexive:
                            MetaSplitter.SplitReflexive treflex = (MetaSplitter.SplitReflexive)i;
                            treflex.offset += reflex.translation + (reflex.chunksize * x);

                            treflex.translation = metasize;
                            treflex.chunkcount = treflex.Chunks.Count;

                            metasize += treflex.chunksize * treflex.chunkcount;
                            treflex.type = Meta.ItemType.Reflexive;
                            treflex.intag = TagIndex;
                            treflex.pointstoTagIndex = TagIndex;
                            destination.Add(treflex);
                            RecursivelyAddPiecesToMeta(treflex, ref destination, ref BW);
                            break;

                        case Meta.ItemType.Ident:
                            MetaSplitter.SplitIdent id = new MetaSplitter.SplitIdent((MetaSplitter.SplitIdent)i);
                            id.offset += reflex.translation + (reflex.chunksize * x);
                            id.intag = TagIndex;
                            destination.Add(id);

                            break;
                        case Meta.ItemType.String:
                            MetaSplitter.SplitString ss = (MetaSplitter.SplitString)i;
                            ss.offset += reflex.translation + (reflex.chunksize * x);
                            ss.intag = TagIndex;
                            destination.Add(ss);
                            break;
                    }
                }
            }
        }