public override string ToString()
{
if (Low == 0)
return "0x0";
// If our guid has an entry and it is an unit or a GO, print its
// name next to the entry (from a database, if enabled)
if (HasEntry())
{
var type = Utilities.ObjectTypeToStore(GetObjectType());
return "Full: 0x" + Low.ToString("X8") + " Type: " + GetHighType()
+ " Entry: " + StoreGetters.GetName(type, (int)GetEntry()) + " Low: " + GetLow();
}
var name = StoreGetters.GetName(this);
switch (GetHighGuidTypeLegacy())
{
case HighGuidTypeLegacy.BattleGround1:
{
var bgType = Low & 0x00000000000000FF;
return "Full: 0x" + Low.ToString("X8") + " Type: " + GetHighType()
+ " BgType: " + StoreGetters.GetName(StoreNameType.Battleground, (int)bgType);
}
case HighGuidTypeLegacy.BattleGround2:
{
var bgType = (Low & 0x00FF0000) >> 16;
var unkId = (Low & 0x0000FF00) >> 8;
var arenaType = (Low & 0x000000FF) >> 0;
return "Full: 0x" + Low.ToString("X8") + " Type: " + GetHighType()
+ " BgType: " + StoreGetters.GetName(StoreNameType.Battleground, (int)bgType)
+ " Unk: " + unkId + (arenaType > 0 ? (" ArenaType: " + arenaType) : String.Empty);
}
}
return "Full: 0x" + Low.ToString("X8") + " Type: " + GetHighType()
+ " Low: " + GetLow() + (String.IsNullOrEmpty(name) ? String.Empty : (" Name: " + name));
}