Пример #1
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     YndXml.ValueTag(sb, indent, "AreaID", AreaID.ToString());
     YndXml.ValueTag(sb, indent, "NodeID", NodeID.ToString());
     YndXml.ValueTag(sb, indent, "JunctionID", JunctionID.ToString());
     YndXml.ValueTag(sb, indent, "Unk0", Unk0.ToString());
 }
Пример #2
0
        public void WriteXml(StringBuilder sb, int indent, byte[] allHeightmapData)
        {
            Vector2 p = new Vector2();

            p.X = PositionX / 4.0f;
            p.Y = PositionY / 4.0f;
            float minz = MinZ / 32.0f;
            float maxz = MaxZ / 32.0f;

            YndXml.SelfClosingTag(sb, indent, "Position " + FloatUtil.GetVector2XmlString(p));
            YndXml.ValueTag(sb, indent, "MinZ", FloatUtil.ToString(minz));
            YndXml.ValueTag(sb, indent, "MaxZ", FloatUtil.ToString(maxz));
            YndXml.ValueTag(sb, indent, "SizeX", HeightmapDimX.ToString());
            YndXml.ValueTag(sb, indent, "SizeY", HeightmapDimY.ToString());

            byte[] hmdata   = null;
            int    hmbcount = HeightmapDimX * HeightmapDimY;

            if (hmbcount > 0)
            {
                hmdata = new byte[hmbcount];
                Buffer.BlockCopy(allHeightmapData, HeightmapPtr, hmdata, 0, hmbcount);
            }
            YndXml.WriteRawArray(sb, hmdata, indent, "Heightmap", "", RelXml.FormatHexByte, Math.Max(HeightmapDimX, (byte)1));
        }
Пример #3
0
        public void WriteXml(StringBuilder sb, int indent, NodeLink[] allLinks)
        {
            Vector3 p = new Vector3();

            p.X = PositionX / 4.0f;
            p.Y = PositionY / 4.0f;
            p.Z = PositionZ / 32.0f;
            int linkCount    = LinkCountFlags.Value >> 3;
            int linkCountUnk = LinkCountFlags.Value & 7;

            YndXml.ValueTag(sb, indent, "AreaID", AreaID.ToString());
            YndXml.ValueTag(sb, indent, "NodeID", NodeID.ToString());
            YndXml.StringTag(sb, indent, "StreetName", YndXml.HashString(StreetName));
            YndXml.SelfClosingTag(sb, indent, "Position " + FloatUtil.GetVector3XmlString(p));
            YndXml.ValueTag(sb, indent, "Flags0", Flags0.Value.ToString());
            YndXml.ValueTag(sb, indent, "Flags1", Flags1.Value.ToString());
            YndXml.ValueTag(sb, indent, "Flags2", Flags2.Value.ToString());
            YndXml.ValueTag(sb, indent, "Flags3", Flags3.Value.ToString());
            YndXml.ValueTag(sb, indent, "Flags4", Flags4.Value.ToString());
            YndXml.ValueTag(sb, indent, "Flags5", linkCountUnk.ToString());

            NodeLink[] links = null;
            if (linkCount > 0)
            {
                links = new NodeLink[linkCount];
                for (int i = 0; i < linkCount; i++)
                {
                    links[i] = allLinks[LinkID + i];
                }
            }
            YndXml.WriteItemArray(sb, links, indent, "Links");
        }
Пример #4
0
        public void WriteXml(StringBuilder sb, int indent)
        {
            YndXml.ValueTag(sb, indent, "VehicleNodeCount", NodesCountVehicle.ToString());
            YndXml.ValueTag(sb, indent, "PedNodeCount", NodesCountPed.ToString());

            XmlNodeWrapper[] nodes = null;
            int nodecount          = Nodes?.Length ?? 0;

            if (nodecount > 0)
            {
                nodes = new XmlNodeWrapper[nodecount];
                for (int i = 0; i < nodecount; i++)
                {
                    nodes[i] = new XmlNodeWrapper(Nodes[i], Links);
                }
            }
            YndXml.WriteItemArray(sb, nodes, indent, "Nodes");


            XmlJunctionWrapper[] juncs = null;
            int junccount = Junctions?.Length ?? 0;

            if (junccount > 0)
            {
                juncs = new XmlJunctionWrapper[junccount];
                for (int i = 0; i < junccount; i++)
                {
                    juncs[i] = new XmlJunctionWrapper(Junctions[i], JunctionHeightmapBytes);
                }
            }
            YndXml.WriteItemArray(sb, juncs, indent, "Junctions");

            YndXml.WriteItemArray(sb, JunctionRefs, indent, "JunctionRefs");
        }
Пример #5
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     YndXml.ValueTag(sb, indent, "ToAreaID", AreaID.ToString());
     YndXml.ValueTag(sb, indent, "ToNodeID", NodeID.ToString());
     YndXml.ValueTag(sb, indent, "Flags0", Flags0.Value.ToString());
     YndXml.ValueTag(sb, indent, "Flags1", Flags1.Value.ToString());
     YndXml.ValueTag(sb, indent, "Flags2", Flags2.Value.ToString());
     YndXml.ValueTag(sb, indent, "LinkLength", LinkLength.Value.ToString());
 }