What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Transform Coordinates to WoWPoint in Plugin

katzerle

New Member
Joined
Jan 18, 2011
Messages
917
Reaction score
68
Heyho
I have two little Problem with a new Plugin.
First Problem
I want to read Blackspots from the Profile to a List
I tried this (Copied from a Plugin which reads Hotspots), but he don't know the Function ToWoWPoint
Code:
public static List<wowpoint> BlacklistedSpots = new List<wowpoint>();
BlacklistedSpots = ProfileManager.CurrentProfile.Blackspots.ConvertAll<wowpoint>(hs => hs.ToWoWPoint());
Could someone tell me the right Function to do this?

Second Problem I have:
I also want to Read Blackspots from a own XML-File
The XML-File looks like this:<blacklist><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999">
see Attachment because the Forum don't like XML-Code ;)


My Code:
Code:
            //Motes from XML to List
            XmlDocument MotesXML = new XmlDocument();
            string sPath = Path.Combine(FolderPath, "config\\MotesBlacklist.xml");
            System.IO.FileStream fs = new System.IO.FileStream(@sPath, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite);
            try
            {
                MotesXML.Load(fs);
                fs.Close();
            }
            catch (Exception e)
            {
                Logging.Write(System.Drawing.Color.Red, e.Message);
                fs.Close();
                return;
            }
            XmlElement root = MotesXML.DocumentElement;
            foreach (XmlNode Node in root.ChildNodes)
            {
                //ToDo
                //WoWPoint BlackPoint = new WoWPoint(0, 0, 0);
                WoWPoint BlackPoint = new WoWPoint(Convert.ToInt32(Node.Attributes["X"].InnerText), Convert.ToInt32(Node.Attributes["Y"].InnerText), Convert.ToInt32(Node.Attributes["Z"].InnerText));
                BlacklistedSpots.Add(BlackPoint);
            }
            // Debug
            foreach (WoWPoint BlackPoint in BlacklistedSpots)
                Logging.Write(System.Drawing.Color.Blue, "Mote Extractor: Blacklisted Spot: {0}", BlackPoint.ToString());
Here is the Problem I don't know what kind of variable the X, Y and Z is in the Function
WoWPoint BlackPoint = new WoWPoint(X, Y, Z);
This works:
WoWPoint BlackPoint = new WoWPoint(-11066.67, -2100.342, 175.2816);

But what is this: </cloud></cloud></cloud></cloud></cloud></cloud></blacklist></wowpoint></wowpoint></wowpoint>-11066.67
Is it a String?
<wowpoint><wowpoint><wowpoint><blacklist><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999"><cloud guid="0" x="999,999" y="9999,999" z="99999,999">

Hopefully someone could help me :o
yours sincerely
katzerle</cloud></cloud></cloud></cloud></cloud></cloud></blacklist></wowpoint></wowpoint></wowpoint>
 

Attachments

Last edited:
I can't help you with the first one, since i haven't worked alot with it, but to answer your second question, then it can be both a double or a float.
 
Thank you very much for the Help, double is correct.

The First one does it give an Solution also for this?
It's not logically not to have a Function to read Blackspots similar to Hotspots...
 
Last edited:
Back
Top