Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 protected CreatureBase()
 {
     Properties  = new PropertiesList();
     Effects     = new EffectList(this);
     MapPosition = new CreaturePosition();
 }