本文整理汇总了C#中Walker.UpdateCache方法的典型用法代码示例。如果您正苦于以下问题:C# Walker.UpdateCache方法的具体用法?C# Walker.UpdateCache怎么用?C# Walker.UpdateCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Walker
的用法示例。
在下文中一共展示了Walker.UpdateCache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
//.........这里部分代码省略.........
if (!this.Client.Player.Connected) continue;
// check if a script waypoint is currently running
if (walker.IsRunning &&
currentWaypoint != null &&
currentWaypoint.Type == Waypoint.Types.Script)
{
continue;
}
Objects.Location playerLoc = this.Client.Player.Location;
IEnumerable<Objects.Creature> creatures = this.Client.BattleList.GetCreatures(false, true),
visiblePlayers = this.Client.BattleList.GetPlayers(true, true);
List<Objects.Creature> visibleCreatures = new List<Objects.Creature>();
foreach (Objects.Creature c in creatures)
{
if (c.IsVisible) visibleCreatures.Add(c);
}
foreach (Objects.Creature c in targeting.GetKilledCreatures(creatures))
{
string name = c.Name.ToLower();
foreach (Target t in this.GetTargets())
{
if (t.Name.ToLower() != name) continue;
if (!corpseLocations.Contains(c.Location)) corpseLocations.Add(c.Location);
break;
}
}
#region targeting
if (targeting.IsRunning)
{
targeting.UpdateCache(tileCollection, visibleCreatures, visiblePlayers);
continue;
}
else if (this.CurrentSettings.KillBeforeLooting || corpseLocations.Count == 0)
{
Target t = this.GetBestTarget(tileCollection, creatures, this.Client.BattleList.GetPlayers(true, true), true);
if (t != null)
{
if (this.CurrentSettings.KillBeforeLooting && looter.IsRunning) looter.CancelExecution();
if (this.Client.TibiaVersion < 810) this.StopwatchExhaust.Restart(); // restart to avoid instant attack->spell/rune
targeting.ExecuteTarget(t, tileCollection, visibleCreatures, visiblePlayers);
continue;
}
}
#endregion
#region looting
if (looter.IsRunning)
{
looter.UpdateCache(tileCollection);
continue;
}
// loot always if there are no waypoints
if (this.Waypoints.Count == 0)
{
List<ushort> ids = new List<ushort>();
foreach (Loot loot in this.GetLoot())
{
ids.Add(loot.ID);
}
foreach (Objects.Container c in this.Client.Inventory.GetContainers(1))
{
if (c.Name.Contains("Backpack")) continue;