private CreaturePosition LoadPlayerPosition(XmlNode root) { CreaturePosition pos = new CreaturePosition(); pos.MapName = root.SelectSingleNode("MapName").InnerText; pos.Position = new Vec3( Convert.ToSingle(root.SelectSingleNode("X").InnerText), Convert.ToSingle(root.SelectSingleNode("Y").InnerText), Convert.ToSingle(root.SelectSingleNode("Z").InnerText) ); return(pos); }
private void SavingPlayerPosition(XmlDocument doc, XmlElement root, CreaturePosition position) { XmlElement mapName = doc.CreateElement("MapName"); XmlElement x = doc.CreateElement("X"); XmlElement y = doc.CreateElement("Y"); XmlElement z = doc.CreateElement("Z"); mapName.InnerText = position.MapName; x.InnerText = position.Position.x.ToString("0.000"); y.InnerText = position.Position.y.ToString("0.000"); z.InnerText = position.Position.z.ToString("0.000"); root.AppendChild(mapName); root.AppendChild(x); root.AppendChild(y); root.AppendChild(z); }
protected CreatureBase() { Properties = new PropertiesList(); Effects = new EffectList(this); MapPosition = new CreaturePosition(); }