public void Init(YndFile ynd, YndNode node1, YndNode node2, NodeLink link) { Ynd = ynd; Node1 = node1; Node2 = node2; RawData = link; }
public static YndFile GetYnd(XmlDocument doc) { YndFile ynd = new YndFile(); ynd.NodeDictionary = new NodeDictionary(); ynd.NodeDictionary.ReadXml(doc.DocumentElement); ynd.InitNodesFromDictionary(); ynd.BuildStructsOnSave = false; //structs don't need to be rebuilt here! return(ynd); }
public void Init(YndFile ynd, NodeJunction junc, NodeJunctionRef reff) { Ynd = ynd; RawData = junc; RefData = reff; MaxZ = junc.MaxZ; MinZ = junc.MinZ; PositionX = junc.PositionX; PositionY = junc.PositionY; }
public void Init(YndFile ynd, Node node) { Ynd = ynd; RawData = node; Vector3 p = new Vector3(); p.X = node.PositionX / 4.0f; p.Y = node.PositionY / 4.0f; p.Z = node.PositionZ / 32.0f; Position = p; LinkCount = node.LinkCountFlags.Value >> 3; LinkCountUnk = node.LinkCountFlags.Value & 7; Colour = GetColour(); }
public static string GetXml(YndFile ynd) { StringBuilder sb = new StringBuilder(); sb.AppendLine(XmlHeader); if ((ynd != null) && (ynd.NodeDictionary != null)) { var name = "NodeDictionary"; OpenTag(sb, 0, name); ynd.NodeDictionary.WriteXml(sb, 1); CloseTag(sb, 0, name); } return(sb.ToString()); }