Пример #1
0
 public static void Serialize(XmlWriter xWrite, WorldMap contents)
 {
     XmlSerializer Writer = new XmlSerializer(contents.GetType());
     XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
     ns.Add("", "http://www.hybrasyl.com/XML/Maps");
     Writer.Serialize(xWrite, contents, ns);
 }
Пример #2
0
        public WorldMap(XSD.WorldMap newWorldMap)
        {
            Points    = new List <MapPoint>();
            Name      = newWorldMap.Name;
            ClientMap = newWorldMap.Clientmap;

            foreach (var point in newWorldMap.Points.Point)
            {
                var mapPoint = new MapPoint(point.X, point.Y)
                {
                    DestinationMap = point.Target.Value,
                    DestinationX   = point.Target.X,
                    DestinationY   = point.Target.Y,
                    Name           = point.Name
                };
                // We don't implement world map point restrictions yet, so we're done here
                Points.Add(mapPoint);
            }
        }
Пример #3
0
 public void SendWorldMap(WorldMap map)
 {
     var x2E = new ServerPacket(0x2E);
     x2E.Write(map.GetBytes());
     x2E.DumpPacket();
     IsAtWorldMap = true;
     Enqueue(x2E);
 }
Пример #4
0
 public static WorldMap Deserialize(XmlReader reader, WorldMap contents = null)
 {
     //reader.Settings.IgnoreWhitespace = false;
     if (contents == null) contents = new WorldMap();
     XmlSerializer XmlSerial = new XmlSerializer(contents.GetType());
     if (XmlSerial.CanDeserialize(reader))
     {
         var xContents = XmlSerial.Deserialize(reader);
         contents = (WorldMap)xContents;
     }
     return contents;
 }