本文整理汇总了C#中WoWPoint类的典型用法代码示例。如果您正苦于以下问题:C# WoWPoint类的具体用法?C# WoWPoint怎么用?C# WoWPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WoWPoint类属于命名空间,在下文中一共展示了WoWPoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuyItemAction
public BuyItemAction()
{
Properties["Location"] = new MetaProp("Location", typeof(string),
new EditorAttribute(typeof(PropertyBag.LocationEditor),
typeof(UITypeEditor)));
Properties["NpcEntry"] = new MetaProp("NpcEntry", typeof(uint),
new EditorAttribute(typeof(PropertyBag.EntryEditor),
typeof(UITypeEditor)));
Properties["ItemID"] = new MetaProp("ItemID", typeof(string));
Properties["Count"] = new MetaProp("Count", typeof(DynamicProperty<int>),
new TypeConverterAttribute(typeof(DynamicProperty<int>.DynamivExpressionConverter)));
Properties["BuyItemType"] = new MetaProp("BuyItemType", typeof(BuyItemActionType),
new DisplayNameAttribute("Buy"));
Properties["BuyAdditively"] = new MetaProp("BuyAdditively", typeof(bool),
new DisplayNameAttribute("Buy Additively"));
ItemID = "";
Count = new DynamicProperty<int>(this, "0"); // dynamic expression
RegisterDynamicProperty("Count");
BuyItemType = BuyItemActionType.Material;
_loc = WoWPoint.Zero;
Location = _loc.ToInvariantString();
NpcEntry = 0u;
BuyAdditively = true;
Properties["ItemID"].Show = false;
Properties["Count"].Show = false;
Properties["BuyAdditively"].Show = false;
Properties["Location"].PropertyChanged += LocationChanged;
Properties["BuyItemType"].PropertyChanged += BuyItemActionPropertyChanged;
}
示例2: MoveToAction
public MoveToAction()
{
Properties["Entry"] = new MetaProp("Entry", typeof (uint),
new EditorAttribute(typeof (PropertyBag.EntryEditor),
typeof (UITypeEditor)),
new DisplayNameAttribute(Pb.Strings["Action_Common_Entry"]));
Properties["Location"] = new MetaProp("Location",
typeof (string),
new EditorAttribute(typeof (PropertyBag.LocationEditor),
typeof (UITypeEditor)),
new DisplayNameAttribute(Pb.Strings["Action_Common_Location"]));
Properties["MoveType"] = new MetaProp("MoveType", typeof (MoveToType),
new DisplayNameAttribute(Pb.Strings["Action_MoveToAction_MoveToType"]));
Properties["Pathing"] = new MetaProp("Pathing", typeof (NavigationType),
new DisplayNameAttribute(Pb.Strings["Action_Common_Use"]));
Entry = 0u;
_loc = WoWPoint.Zero;
Location = _loc.ToInvariantString();
MoveType = MoveToType.Location;
Pathing = NavigationType.Navigator;
Properties["Entry"].Show = false;
Properties["MoveType"].PropertyChanged += MoveToActionPropertyChanged;
Properties["Location"].PropertyChanged += LocationChanged;
}
示例3: DefendObject
/// <summary>
/// Defends an Object.
/// </summary>
/// <remarks>
/// Created 12/8/2010.
/// </remarks>
/// <param name="args">A variable-length parameters list containing arguments.</param>
public DefendObject(Dictionary<string, string> args) : base(args)
{
try
{
_location = GetAttributeAsNullable("", false, ConstrainAs.WoWPointNonEmpty, null) ?? _me.Location;
_objectId = GetNumberedAttributesAsArray<uint>("ObjectId", 1, null, new[] {"NpcId", "MobId"}) ?? new uint[] { 27430 };
_questId = GetAttributeAsNullable("QuestId", false, ConstrainAs.QuestId(this), null) ?? 0;
_questRequirementComplete = GetAttributeAsNullable<QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete;
_questRequirementInLog = GetAttributeAsNullable<QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog;
_maxRange = GetAttributeAsNullable<int>("MaxRange", false, null, null) ?? 40;
}
catch (Exception except)
{
// Maintenance problems occur for a number of reasons. The primary two are...
// * Changes were made to the behavior, and boundary conditions weren't properly tested.
// * The Honorbuddy core was changed, and the behavior wasn't adjusted for the new changes.
// In any case, we pinpoint the source of the problem area here, and hopefully it
// can be quickly resolved.
LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message
+ "\nFROM HERE:\n"
+ except.StackTrace + "\n");
IsAttributeProblem = true;
}
}
示例4: BuyItemFromAhAction
public BuyItemFromAhAction() {
Properties["ItemID"] = new MetaProp("ItemID", typeof(string));
Properties["MaxBuyout"] = new MetaProp("MaxBuyout", typeof(PropertyBag.GoldEditor),
new DisplayNameAttribute("Max Buyout"), new TypeConverterAttribute(typeof(PropertyBag.GoldEditorConverter)));
Properties["Amount"] = new MetaProp("Amount", typeof(uint));
Properties["ItemListType"] = new MetaProp("ItemListType", typeof(ItemType), new DisplayNameAttribute("Buy ..."));
Properties["AutoFindAh"] = new MetaProp("AutoFindAh", typeof(bool), new DisplayNameAttribute("Auto find AH"));
Properties["BuyAdditively"] = new MetaProp("BuyAdditively", typeof(bool), new DisplayNameAttribute("Buy Additively"));
Properties["BidOnItem"] = new MetaProp("BidOnItem", typeof(bool), new DisplayNameAttribute("Bid on Item"));
Properties["Location"] = new MetaProp("Location", typeof(string), new EditorAttribute(typeof(PropertyBag.LocationEditor), typeof(UITypeEditor)));
ItemID = "";
Amount = 1u;
ItemListType = ItemType.Item;
AutoFindAh = true;
loc = WoWPoint.Zero;
Location = loc.ToInvariantString();
MaxBuyout = new PropertyBag.GoldEditor("100g0s0c");
BidOnItem = false;
BuyAdditively = true;
Properties["AutoFindAh"].PropertyChanged += new EventHandler(AutoFindAHChanged);
Properties["ItemListType"].PropertyChanged += new EventHandler(BuyItemFromAhAction_PropertyChanged);
Properties["Location"].PropertyChanged += new EventHandler(LocationChanged);
Properties["Amount"].Show = true;
Properties["Location"].Show = false;
}
示例5: ProcessSlopeAndLavaResults
public static List<WoWPoint> ProcessSlopeAndLavaResults(List<WoWPoint> testPoints, WoWPoint[] slopePoints,
bool[] lavaHits)
{
//float slopeRise = AutoAngler2.Instance.MySettings.LandingSpotSlope / 2;
const float slopeRise = 0.60f;
var retList = new List<WoWPoint>();
for (int i = 0; i < testPoints.Count; i++)
{
if (slopePoints[i*4] != WoWPoint.Zero &&
slopePoints[i*4 + 1] != WoWPoint.Zero &&
slopePoints[i*4 + 2] != WoWPoint.Zero &&
slopePoints[i*4 + 3] != WoWPoint.Zero &&
// check for lava hits
(lavaHits == null ||
(lavaHits != null &&
!lavaHits[i*4] &&
!lavaHits[i*4 + 1] &&
!lavaHits[i*4 + 2] &&
!lavaHits[i*4 + 3]))
)
{
if (ElevationDifference(testPoints[i], slopePoints[(i*4)]) <= slopeRise &&
ElevationDifference(testPoints[i], slopePoints[(i*4) + 1]) <= slopeRise &&
ElevationDifference(testPoints[i], slopePoints[(i*4) + 2]) <= slopeRise &&
ElevationDifference(testPoints[i], slopePoints[(i*4) + 3]) <= slopeRise)
{
retList.Add(testPoints[i]);
}
}
}
return retList;
}
示例6: Transport
public Transport(Dictionary<string, string> args)
: base(args)
{
CheckForUnrecognizedAttributes(recognizedAttributes);
WoWPoint getOnlocation = new WoWPoint(0, 0, 0);
WoWPoint getOfflocation = new WoWPoint(0, 0, 0);
WoWPoint reachedlocation = new WoWPoint(0, 0, 0);
WoWPoint endlocation = new WoWPoint(0, 0, 0);
WoWPoint docklocation = new WoWPoint(0, 0, 0);
WoWPoint shipstand = new WoWPoint(0, 0, 0);
int questId = 0;
int objectId = 0;
success = success && GetAttributeAsInteger("ObjectId", true, "1", 0, int.MaxValue, out objectId);
success = success && GetAttributeAsInteger("QuestId", false, "0", 0, int.MaxValue, out questId);
success = success && GetXYZAttributeAsWoWPoint("TransGetOnX", "TransGetOnY", "TransGetOnZ", true, new WoWPoint(0, 0, 0), out reachedlocation);
success = success && GetXYZAttributeAsWoWPoint("TransGetOffX", "TransGetOffY", "TransGetOffZ", true, new WoWPoint(0, 0, 0), out endlocation);
success = success && GetXYZAttributeAsWoWPoint("GetOnX", "GetOnY", "GetOnZ", true, new WoWPoint(0, 0, 0), out getOnlocation);
success = success && GetXYZAttributeAsWoWPoint("GetOffX", "GetOffY", "GetOffZ", true, new WoWPoint(0, 0, 0), out getOfflocation);
success = success && GetXYZAttributeAsWoWPoint("X", "Y", "Z", false, new WoWPoint(0, 0, 0), out docklocation);
success = success && GetXYZAttributeAsWoWPoint("TransStandX", "TransStandY", "TransStandZ", false, new WoWPoint(0, 0, 0), out shipstand);
QuestId = (uint)questId;
ObjectID = objectId;
GetOnLocation = getOnlocation;
GetOffLocation = getOfflocation;
ReachedLocation = reachedlocation;
EndLocation = endlocation;
Location = docklocation;
ShipStandLocation = shipstand;
Counter = 0;
}
示例7: safeMoveTo
private static void safeMoveTo(WoWPoint point)
{
try
{
WoWPoint movePoint = point;
if (Navigator.GeneratePath(Me.Location, movePoint).Length == 0)
{
Log("Can not generate navigation path to tank. Something wrong with mesh");
errorCount++;
if (errorCount > 50)
warningSound();
}
else
{
errorCount = 0;
soundPlayed = false;
Navigator.MoveTo(movePoint);
Thread.Sleep(100);
}
}
catch (System.Threading.ThreadAbortException) { throw; }
catch (Exception c)
{
Log("This instance has not been meshed yet");
dLog("{0}", c);
warningSound();
}
}
示例8: CancelAuctionAction
public CancelAuctionAction()
{
Properties["ItemID"] = new MetaProp("ItemID", typeof(string), new DisplayNameAttribute("Item ID List"));
Properties["AutoFindAh"] = new MetaProp("AutoFindAh", typeof(bool), new DisplayNameAttribute("Auto find AH"));
Properties["Location"] = new MetaProp("Location", typeof(string), new EditorAttribute(typeof(PropertyBag.LocationEditor), typeof(UITypeEditor)));
Properties["UseCategory"] = new MetaProp("UseCategory", typeof(bool), new DisplayNameAttribute("Use Category"));
Properties["Category"] = new MetaProp("Category", typeof(WoWItemClass), new DisplayNameAttribute("Item Category"));
Properties["SubCategory"] = new MetaProp("SubCategory", typeof(WoWItemTradeGoodsClass), new DisplayNameAttribute("Item SubCategory"));
Properties["MinBuyout"] = new MetaProp("MinBuyout", typeof(PropertyBag.GoldEditor),
new DisplayNameAttribute("Min Buyout"), new TypeConverterAttribute(typeof(PropertyBag.GoldEditorConverter)));
ItemID = "0";
AutoFindAh = true;
loc = WoWPoint.Zero;
Location = loc.ToInvariantString();
UseCategory = false;
Category = WoWItemClass.TradeGoods;
SubCategory = WoWItemTradeGoodsClass.None;
MinBuyout = new PropertyBag.GoldEditor("0g0s0c");
Properties["AutoFindAh"].PropertyChanged += new EventHandler(AutoFindAHChanged);
Properties["Location"].PropertyChanged += new EventHandler(LocationChanged);
Properties["UseCategory"].PropertyChanged += UseCategoryChanged;
Properties["Category"].PropertyChanged += CategoryChanged;
Properties["Category"].Show = false;
Properties["SubCategory"].Show = false;
Properties["Location"].Show = false;
}
示例9: LocationChanged
void LocationChanged(object sender, EventArgs e) {
MetaProp mp = (MetaProp)sender;
loc = Util.StringToWoWPoint((string)((MetaProp)sender).Value);
Properties["Location"].PropertyChanged -= new EventHandler(LocationChanged);
Properties["Location"].Value = string.Format("<{0}, {1}, {2}>", loc.X, loc.Y, loc.Z);
Properties["Location"].PropertyChanged += new EventHandler(LocationChanged);
RefreshPropertyGrid();
}
示例10: Run
public override bool Run(WoWPoint location, int distance)
{
var nearestLocationToObject = WoWMathHelper.CalculatePointFrom(StyxWoW.Me.Location, location, distance);
var pathToDest =
Navigator.GeneratePath(StyxWoW.Me.Location, nearestLocationToObject);
if (_recursiveHandlerCount >= 5)
{
Helper.UseHeartStone();
_recursiveHandlerCount = 0;
}
else
{
if (pathToDest.Count() == 0)
{
_recursiveHandlerCount++;
Run(ProfileManager.CurrentProfile.HotspotManager.GetNextHotspot(), 10);
return false;
}
}
foreach (var localDest in pathToDest)
{
if (!StyxWoW.Me.IsFlying && !Navigator.CanNavigateFully(StyxWoW.Me.Location, localDest, 8192))
{
Logging.Write(Colors.Red, "Cant navigate to the destination.");
return false;
}
try
{
if (Helper.BlacklistHotspot(localDest)) return true;
while (localDest.Distance(StyxWoW.Me.Location) >= 5 && TreeRoot.IsRunning)
{
if (Helper.BlacklistHotspot(localDest)) return true;
if (Helper.GetInCombat()) break;
ClassBase.Avoid();
if(!ShouldStayStealth) Helper.MountUp(ClassBase.MountName);
Navigator.MoveTo(localDest);
Thread.Sleep(100);
}
if (Helper.GetInCombat()) break;
}
catch (Exception exception)
{
Logging.Write(Colors.Red, exception.Message);
}
}
return true;
}
示例11: HeightOffTheGround
/// <summary>
/// calculate a unit's vertical distance (height) above ground level (mesh). this is the units position
/// relative to the ground and is independent of any other character.
/// </summary>
/// <param name="u">unit</param>
/// <returns>float.MinValue if can't determine, otherwise distance off ground</returns>
public static float HeightOffTheGround(this WoWUnit u)
{
var unitLoc = new WoWPoint( u.Location.X, u.Location.Y, u.Location.Z);
var listMeshZ = Navigator.FindHeights( unitLoc.X, unitLoc.Y).Where( h => h <= unitLoc.Z);
if (listMeshZ.Any())
return unitLoc.Z - listMeshZ.Max();
return float.MaxValue;
}
示例12: MoveTo
internal static void MoveTo(WoWPoint Location)
{
MoveTo(Location.X, Location.Y, Location.Z);
// Rewrite this using just 1 write, as a struct.
// from mem it was this ->
//var CTM = new WoWMovement.ClickToMoveInfoStruct;
}
示例13: UseHearthstone
public UseHearthstone(Dictionary<string, string> args)
: base(args)
{
m_Complete = false;
try
{
if (Args.ContainsKey("OutsideDistance"))
{
float Distance = 0.0f;
if (!float.TryParse(Args["OutsideDistance"], out Distance))
{
throw new ArgumentException("Parsing attribute 'OutsideDistance' in SetHearthstone behavior failed! Please check your profile!");
}
m_OutsideDistance = Distance;
}
else
{
m_OutsideDistance = null;
}
float X;
float Y;
float Z;
if (!float.TryParse(Args["X"], out X))
{
throw new ArgumentException("Parsing attribute 'X' in SetHearthstone behavior failed! Please check your profile!");
}
if (!float.TryParse(Args["Y"], out Y))
{
throw new ArgumentException("Parsing attribute 'Y' in SetHearthstone behavior failed! Please check your profile!");
}
if (!float.TryParse(Args["Z"], out Z))
{
throw new ArgumentException("Parsing attribute 'Z' in SetHearthstone behavior failed! Please check your profile!");
}
m_Location = new WoWPoint(X, Y, Z);
if (!uint.TryParse(Args["HearthLocation"], out m_HearthLocation))
{
throw new ArgumentException("Parsing attribute 'HearthLocation' in SetHearthstone behavior failed! Please check your profile!");
}
}
catch (Exception Ex)
{
Logging.Write(string.Format("Failed to create UseHearthstone behavior.\nException:\n{0}", Ex.ToString()));
Thread.CurrentThread.Abort();
}
}
示例14: TrainSkillAction
public TrainSkillAction()
{
Properties["Location"] = new MetaProp("Location", typeof(string), new EditorAttribute(typeof(PropertyBag.LocationEditor), typeof(UITypeEditor)));
Properties["NpcEntry"] = new MetaProp("NpcEntry", typeof(uint), new EditorAttribute(typeof(PropertyBag.EntryEditor), typeof(UITypeEditor)));
loc = WoWPoint.Zero;
Location = loc.ToInvariantString();
NpcEntry = 0u;
Properties["Location"].PropertyChanged += new EventHandler(LocationChanged);
}
示例15: movetoLoc
public static void movetoLoc(WoWPoint loc)
{
while (loc.Distance(Me.Location) > 10)
{
Navigator.MoveTo(loc);
Thread.Sleep(100);
if (inCombat) return;
}
Thread.Sleep(2000);
}