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

WoWPoint default value?

strix

New Member
Joined
Feb 13, 2010
Messages
442
Reaction score
18
For most things it's null, but WoWPoint isn't nullable.
So what is WoWPoint's default value (using *.FirstOrDefault() extensions)?

I see there is WoWPoint.Empty and WoWPoint.Zero, but can't distinguish which is default.
 
Last edited:
I would assume X Y and Z are all filled with 0's on declaration.
Try doing a quick Log(string.Format("X:{0} Y:{1} Z:{2}",_WPoint.X.ToString(), _WPoint.Y.ToSring(), _WPoint.Z.ToString()));
 
i can't run HB on EU right now ;d

but still new WoWPoint() might be Empty, while default might be Zero or the other way aroundalso coordinates (0,0,0) still might be some valid location
 
Last edited:
I don't, i need to be sure what List<WoWPoint>.FirstOrDefault() returns for default, so i can check against existance of point.
 
Ah... well without the bigger picture of what you want to do with it I cant really help anymore.

I'm not sure i get exactly what you're trying to do.

If you have a List<WoWPoint> xxx, then you could return the FirstOrDefault() from that list, but you can't do the same with a WoWPoint.

Just threw "private WoWPoint xxx = null;" into a class of my plugin, and it didn't claim it was not nullable. It would work just fine.
 
I have class:
PHP:
class HSInfo
    {
        public uint MapID;
        public uint AreaID;
        public WoWPoint Location;
        public bool ForAlliance;
        public bool ForHorde;

        public HSInfo(uint mapID, uint areaID, bool forAlliance, bool forHorde, WoWPoint location)
        {
            MapID = mapID;
            AreaID = areaID;
            ForAlliance = forAlliance;
            ForHorde = forHorde;
            Location = location;
        }
    }
and i have List<HSInfo> from which i retrieve Location.
Doing doublecheck Exists() then First() isn't too efficient, i would rather check if the value is that Default or not.<HSInfo>
 
Last edited:
I see what you're getting at here
This end product is gonna be sweet

But unfortunately I don't have that much experience with this level of programming.
Maybe shoot Smarter a message :)
Or maybe google :)
 
is it possible to see the code in its entirety? its hard to find out exactly whats going on with the little bit you've posted there.
 
After some testing looks like WoWPoint.Zero is equal to WoWPoint.Empty and Default value is equal to both of these.
No idea why are there 2 different names for same thing ;d

About the issue, it was indeed placed in other part.
 
Last edited:
I don't, i need to be sure what List<WoWPoint>.FirstOrDefault() returns for default, so i can check against existance of point.

Don't pin me down on it, but I'm fairly sure you can also do:
Code:
var points = new List<Point>();

var first = List.FirstOrDefault();

if (first != null)
{
    // Do our stuff here.
}
 
Back
Top