Esempio n. 1
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     YpdbXml.SelfClosingTag(sb, indent, "BoundsMin " + FloatUtil.GetVector3XmlString(BoundsMin));
     YpdbXml.SelfClosingTag(sb, indent, "BoundsMax " + FloatUtil.GetVector3XmlString(BoundsMax));
     YpdbXml.WriteRawArray(sb, Points, indent, "Points", "", YpdbXml.FormatVector3, 1);
     YpdbXml.WriteRawArray(sb, Weights, indent, "Weights", "", FloatUtil.ToString);
 }
Esempio n. 2
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     CacheDatXml.StringTag(sb, indent, "name", CacheDatXml.HashString(Name));
     CacheDatXml.SelfClosingTag(sb, indent, "bbMin " + FloatUtil.GetVector3XmlString(Min));
     CacheDatXml.SelfClosingTag(sb, indent, "bbMax " + FloatUtil.GetVector3XmlString(Max));
     CacheDatXml.ValueTag(sb, indent, "layer", Layer.ToString());
 }
Esempio n. 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");
        }
Esempio n. 4
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     YwrXml.SelfClosingTag(sb, indent, "Position " + FloatUtil.GetVector3XmlString(Position));
     YwrXml.ValueTag(sb, indent, "Unk0", Unk0.ToString());
     YwrXml.ValueTag(sb, indent, "Unk1", Unk1.ToString());
     YwrXml.ValueTag(sb, indent, "Unk2", Unk2.ToString());
     YwrXml.ValueTag(sb, indent, "Unk3", Unk3.ToString());
 }
Esempio n. 5
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     YvrXml.ValueTag(sb, indent, "Time", Time.ToString());
     YvrXml.SelfClosingTag(sb, indent, "Position " + FloatUtil.GetVector3XmlString(Position));
     YvrXml.SelfClosingTag(sb, indent, "Velocity " + FloatUtil.GetVector3XmlString(Velocity));
     YvrXml.SelfClosingTag(sb, indent, "Forward " + FloatUtil.GetVector3XmlString(Forward));
     YvrXml.SelfClosingTag(sb, indent, "Right " + FloatUtil.GetVector3XmlString(Right));
     YvrXml.ValueTag(sb, indent, "Steering", FloatUtil.ToString(Steering));
     YvrXml.ValueTag(sb, indent, "GasPedal", FloatUtil.ToString(GasPedal));
     YvrXml.ValueTag(sb, indent, "BrakePedal", FloatUtil.ToString(BrakePedal));
     YvrXml.ValueTag(sb, indent, "Handbrake", Handbrake.ToString());
 }
Esempio n. 6
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     if (Endianess != Endianess.BigEndian)
     {
         HmapXml.StringTag(sb, indent, "Endianess", Endianess.ToString());
     }
     HmapXml.ValueTag(sb, indent, "Width", Width.ToString());
     HmapXml.ValueTag(sb, indent, "Height", Height.ToString());
     HmapXml.SelfClosingTag(sb, indent, "BBMin " + FloatUtil.GetVector3XmlString(BBMin));
     HmapXml.SelfClosingTag(sb, indent, "BBMax " + FloatUtil.GetVector3XmlString(BBMax));
     HmapXml.WriteRawArray(sb, InvertImage(MaxHeights, Width, Height), indent, "MaxHeights", "", HmapXml.FormatHexByte, Width);
     HmapXml.WriteRawArray(sb, InvertImage(MinHeights, Width, Height), indent, "MinHeights", "", HmapXml.FormatHexByte, Width);
 }
Esempio n. 7
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     CacheDatXml.StringTag(sb, indent, "name", CacheDatXml.HashString(Name));
     CacheDatXml.StringTag(sb, indent, "parent", CacheDatXml.HashString(ParentName));
     CacheDatXml.ValueTag(sb, indent, "contentFlags", ContentFlags.ToString());
     CacheDatXml.SelfClosingTag(sb, indent, "streamingExtentsMin " + FloatUtil.GetVector3XmlString(streamingExtentsMin));
     CacheDatXml.SelfClosingTag(sb, indent, "streamingExtentsMax " + FloatUtil.GetVector3XmlString(streamingExtentsMax));
     CacheDatXml.SelfClosingTag(sb, indent, "entitiesExtentsMin " + FloatUtil.GetVector3XmlString(entitiesExtentsMin));
     CacheDatXml.SelfClosingTag(sb, indent, "entitiesExtentsMax " + FloatUtil.GetVector3XmlString(entitiesExtentsMax));
     CacheDatXml.ValueTag(sb, indent, "unk1", Unk1.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk2", Unk2.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk3", Unk3.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk4", Unk4.ToString());
 }
Esempio n. 8
0
 public void WriteXml(StringBuilder sb, int indent)
 {
     CacheDatXml.StringTag(sb, indent, "name", CacheDatXml.HashString(Name));
     CacheDatXml.StringTag(sb, indent, "parent", CacheDatXml.HashString(Parent));
     CacheDatXml.SelfClosingTag(sb, indent, "position " + FloatUtil.GetVector3XmlString(Position));
     CacheDatXml.SelfClosingTag(sb, indent, "rotation " + FloatUtil.GetVector4XmlString(Orientation.ToVector4()));
     CacheDatXml.SelfClosingTag(sb, indent, "bbMin " + FloatUtil.GetVector3XmlString(BBMin));
     CacheDatXml.SelfClosingTag(sb, indent, "bbMax " + FloatUtil.GetVector3XmlString(BBMax));
     CacheDatXml.ValueTag(sb, indent, "unk01", Unk01.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk02", Unk02.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk03", Unk03.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk11", Unk11.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk12", Unk12.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk13", Unk13.ToString());
     CacheDatXml.ValueTag(sb, indent, "unk14", Unk14.ToString());
 }
Esempio n. 9
0
        public string GetXml()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(MetaXmlBase.XmlHeader);
            sb.AppendLine(string.Format("<CacheDatFile version=\"{0}\">", Version));
            sb.AppendLine(" <fileDates>");
            if (FileDates != null)
            {
                foreach (var date in FileDates)
                {
                    sb.AppendLine(string.Format("  <fileDate>{0}</fileDate>", date.ToCacheFileString()));
                }
            }
            sb.AppendLine(" </fileDates>");
            sb.AppendLine(" <module type=\"fwMapDataStore\">");
            if (AllMapNodes != null)
            {
                foreach (var mapnode in AllMapNodes)
                {
                    sb.AppendLine("  <Item>");
                    sb.AppendLine(string.Format("   <name>{0}</name>", mapnode.Name.ToCleanString()));
                    sb.AppendLine(string.Format("   <parent>{0}</parent>", mapnode.ParentName.ToCleanString()));
                    sb.AppendLine(string.Format("   <contentFlags value=\"{0}\" />", mapnode.ContentFlags.ToString()));
                    sb.AppendLine(string.Format("   <streamingExtentsMin {0} />", FloatUtil.GetVector3XmlString(mapnode.streamingExtentsMin)));
                    sb.AppendLine(string.Format("   <streamingExtentsMax {0} />", FloatUtil.GetVector3XmlString(mapnode.streamingExtentsMax)));
                    sb.AppendLine(string.Format("   <entitiesExtentsMin {0} />", FloatUtil.GetVector3XmlString(mapnode.entitiesExtentsMin)));
                    sb.AppendLine(string.Format("   <entitiesExtentsMax {0} />", FloatUtil.GetVector3XmlString(mapnode.entitiesExtentsMax)));
                    sb.AppendLine(string.Format("   <flags unk1=\"{0}\" unk2=\"{1}\" unk3=\"{2}\" />", mapnode.Unk1, mapnode.Unk2, mapnode.Unk3));
                    sb.AppendLine("  </Item>");
                }
            }
            sb.AppendLine(" </module>");
            sb.AppendLine(" <module type=\"CInteriorProxy\">");
            if (AllCInteriorProxies != null)
            {
                foreach (var intprox in AllCInteriorProxies)
                {
                    sb.AppendLine("  <Item>");
                    sb.AppendLine(string.Format("   <name>{0}</name>", intprox.Name.ToCleanString()));
                    sb.AppendLine(string.Format("   <parent>{0}</parent>", intprox.Parent.ToCleanString()));
                    sb.AppendLine(string.Format("   <position {0} />", FloatUtil.GetVector3XmlString(intprox.Position)));
                    sb.AppendLine(string.Format("   <rotation {0} />", FloatUtil.GetQuaternionXmlString(intprox.Orientation)));
                    sb.AppendLine(string.Format("   <aabbMin {0} />", FloatUtil.GetVector3XmlString(intprox.BBMin)));
                    sb.AppendLine(string.Format("   <aabbMax {0} />", FloatUtil.GetVector3XmlString(intprox.BBMax)));
                    sb.AppendLine(string.Format("   <unknowns1 unk01=\"{0}\" unk03=\"{1}\" />", intprox.Unk01, intprox.Unk03));
                    sb.AppendLine(string.Format("   <unknowns2 unk11=\"{0}\" unk12=\"{1}\" unk13=\"{1}\" unk14=\"{1}\" />", intprox.Unk11, intprox.Unk12, intprox.Unk13, intprox.Unk14));
                    sb.AppendLine(string.Format("   <unknowns3 unk15=\"{0}\" unk16=\"{1}\" unk17=\"{1}\" unk18=\"{1}\" />", intprox.Unk15, intprox.Unk16, intprox.Unk17, intprox.Unk18));
                    sb.AppendLine("  </Item>");
                }
            }
            sb.AppendLine(" </module>");
            sb.AppendLine(" <module type=\"BoundsStore\">");
            if (AllBoundsStoreItems != null)
            {
                foreach (var bndstore in AllBoundsStoreItems)
                {
                    sb.AppendLine("  <Item>");
                    sb.AppendLine(string.Format("   <name>{0}</name>", bndstore.Name.ToCleanString()));
                    sb.AppendLine(string.Format("   <aabbMin {0} />", FloatUtil.GetVector3XmlString(bndstore.Min)));
                    sb.AppendLine(string.Format("   <aabbMax {0} />", FloatUtil.GetVector3XmlString(bndstore.Max)));
                    sb.AppendLine(string.Format("   <layer value=\"{0}\" />", bndstore.Layer));
                    sb.AppendLine("  </Item>");
                }
            }
            sb.AppendLine(" </module>");
            sb.AppendLine("</CacheDatFile>");
            return(sb.ToString());
        }