本文整理汇总了C#中WoWPoint.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# WoWPoint.ToString方法的具体用法?C# WoWPoint.ToString怎么用?C# WoWPoint.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoWPoint
的用法示例。
在下文中一共展示了WoWPoint.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveTo
/// <summary>
/// Location is cached.
/// </summary>
/// <param name="location"></param>
/// <param name="precision"></param>
public MoveTo(WoWPoint location, float precision = 0.0f)
{
if (location == default(WoWPoint))
{
Status = new Result(ActionResult.Failed, "Location is equal to default value.");
GarrisonButler.Diagnostic("Creating MoveTo Failed Location is equal to default value");
return;
}
GarrisonButler.Diagnostic("Creating MoveTo at {0} (p={1})", location.ToString(), precision);
Location.X = location.X;
Location.Y = location.Y;
Location.Z = location.Z;
if (Math.Abs(precision) < Navigator.PathPrecision)
_precision = Navigator.PathPrecision;
else
_precision = precision;
}
示例2: findSafeFlightPoint
private static WoWPoint findSafeFlightPoint(WoWPoint loc)
{
#region If multiple layers (heights), attempt to land somewhere nearby
var _heights = Logic.Pathing.Navigator.FindHeights(loc.X, loc.Y);
_heights.Sort();
if (_heights.Count() > 1)
{
Random rand = new Random();
var i = 1;
var _newSpot = new WoWPoint(0, 0, 0);
while (i < 100)
{
_newSpot = new WoWPoint((loc.X + rand.Next(-i, i)), (loc.Y + rand.Next(-i, i)), 0);
while (Logic.Pathing.Navigator.FindHeights(_newSpot.X, _newSpot.Y).Count() > 1)
{
_newSpot = new WoWPoint((loc.X + rand.Next(-i, i)), (loc.Y + rand.Next(-i, i)), 0);
i = i + 1;
}
Logic.Pathing.Navigator.FindHeight(_newSpot.X, _newSpot.Y, out _newSpot.Z);
if (Navigator.CanNavigateFully(_newSpot, loc) && clearSpot(_newSpot))
{
Log("Took {0} tries to find a safe(?) spot!", i);
Log("Landing spot: {0}", _newSpot.ToString());
return _newSpot;
}
}
Log("No safe spot found :(");
return loc;
}
#endregion
#region If 1 layer, but no LOS from above, attempt to land somewhere nearby
else if (!WoWInternals.World.GameWorld.IsInLineOfSightOCD(new WoWPoint(loc.X, loc.Y, loc.Z+50), loc))
{
Random rand = new Random();
var i = 1;
var _newSpot = new WoWPoint(0, 0, 0);
while (i < 100)
{
_newSpot = new WoWPoint((loc.X + rand.Next(-i, i)), (loc.Y + rand.Next(-i, i)), 0);
i = i + 1;
Logic.Pathing.Navigator.FindHeight(_newSpot.X, _newSpot.Y, out _newSpot.Z);
if (Navigator.CanNavigateFully(_newSpot, loc) && clearSpot(_newSpot))
{
Log("Took {0} tries to find a safe(?) spot!", i);
Log("Landing point: {0}", _newSpot.ToString());
return _newSpot;
}
}
Log("No safe spot found :(");
return loc;
}
#endregion
else
{
return loc;
}
}
示例3: WoWPointNamed
public WoWPointNamed(WoWPoint location,
string name,
bool isStarting)
{
Location = location;
Name = (!string.IsNullOrEmpty(name) ? name : location.ToString());
IsStarting = isStarting;
}
示例4: SetTotemsAsNeeded
/// <summary>
/// SetTotemsAsNeeded() - manages casting totems as called for by environment and
/// user configuration values. This code uses:
/// http://www.yawb.info/2009/08/25/learning-about-totems-tips-to-aid-your-growing-shamanism/
/// as a guideline for totem usage while leveling.
/// </summary>
private bool SetTotemsAsNeeded()
{
bool castTotem = false;
try
{
if (!_me.Fleeing && (Shaman.cfg.FarmingLowLevel || _me.IsMoving))
return false;
// limit how frequently we check totems. needs to be often,
// .. but not each loop.
// ..
if (_TotemCheckTimer.ElapsedMilliseconds < 1500)
{
// if this isn't first time here since reset, then wait for 2 seconds
if (!_me.Fleeing && _TotemCheckTimer.ElapsedMilliseconds > 0 && TotemsWereSet())
return false;
// otherwise, only 0 if first check after last .Reset
// .. so continue processing
}
if (TotemsWereSet() && _ptTotems.Distance(_me.Location) > Shaman.cfg.DistanceForTotemRecall)
{
Shaman.Dlog("Recalling Totems that were set {0:F1} yds away at point {1}", _ptTotems.Distance(_me.Location), _ptTotems.ToString());
RecallTotemsForMana();
}
_TotemCheckTimer.Reset();
_TotemCheckTimer.Start();
//-----
// if you make it past the following gate, only limited tests are needed for each totem
//-----
if (IsPVP() || Shaman.IsRAF())
;
else if (Shaman.IsFightStressful() || !Shaman.cfg.PVE_SaveForStress_TotemsSelected)
;
else
{
Shaman.Dlog("not setting totems until a stressful situation");
return false;
}
// check which totems exist
bool bAnyTotemsUp = TotemExist(TOTEM_EARTH)
|| TotemExist(TOTEM_FIRE)
|| TotemExist(TOTEM_WATER)
|| TotemExist(TOTEM_AIR);
Shaman.Dlog("SetTotemsAsNeeded: earth: " + BoolToYN(TotemExist(TOTEM_EARTH)) + " fire: " + BoolToYN(TotemExist(TOTEM_FIRE)) + " water: " + BoolToYN(TotemExist(TOTEM_WATER)) + " air: " + BoolToYN(TotemExist(TOTEM_AIR)));
_WereTotemsSet = bAnyTotemsUp; // _WereTotemsSet || removed because only matters if they exist
// Quick scan for mobs that cast fear (only in RAF)
//////////////////////////////////////////////////////////////////////
Shaman.foundMobsThatFear = _me.Fleeing;
if (Shaman.foundMobsThatFear)
Shaman.Slog("Tremor Totem: detected fear mob");
// Totem Bar Set
// -- add handling for changing totem bar setup temporarily if needed for tremor totem
//////////////////////////////////////////////////////////////////////
const string totemBar = "Call of the Elements";
if (!bAnyTotemsUp && SpellManager.HasSpell(totemBar) )
{
TotemId saveEarthTotemSetup = TotemId.TREMOR_TOTEM;
// if mobs that fear are found and tremor not in bar setup already, add temporarily just for cast
if (Shaman.foundMobsThatFear && _totemBar[TOTEM_EARTH] != TotemId.TREMOR_TOTEM)
{
saveEarthTotemSetup = _totemBar[TOTEM_EARTH];
TotemSelect(TOTEM_EARTH, TotemId.TREMOR_TOTEM);
}
if (Shaman.Safe_CastSpell(totemBar, Shaman.SpellRange.NoCheck, Shaman.SpellWait.Complete))
{
castTotem = true;
_WereTotemsSet = true;
_ptTotems = _me.Location;
if (IsRAF())
Dlog("SetTotemsAsNeeded: set totems at <{0}> {1:F1} yds from Leader", _ptTotems.ToString(), GroupTank.Distance);
else
Dlog("SetTotemsAsNeeded: set totems at <{0}>", _ptTotems.ToString());
}
// if we changed the earth totem on bar, restore back to configured value
if (saveEarthTotemSetup != TotemId.TREMOR_TOTEM)
{
TotemSelect(TOTEM_EARTH, saveEarthTotemSetup);
}
}
//.........这里部分代码省略.........