public PoEObject ParseToObject(string response) { this.PoEObject = PoEObject.FromJson(response); this.dataSource.NextID = this.PoEObject.NextChangeId; Console.WriteLine("(INFO) Response parsing complete"); return(this.PoEObject); }
public static bool NumberOfMobsNear(PoEObject Target, float distance, int count) { if (Target == null) { return(false); } Vector2i mpos = Target.Position; int curCount = 0; foreach (Monster mob in Targeting.Combat.Targets) { if (mob.ID == Target.ID) { continue; } if (mob.Position.Distance(mpos) < distance && !mob.IsDead) { curCount++; } if (curCount >= count) { return(true); } } return(false); }
public static bool NumberOfEnemysNear(PoEObject Target, float distance, int count) { return(LokiPoe.EntityManager.OfType <Actor>().Count(a => !a.IsDead && !a.IsFriendly && a.Distance <= distance) >= count); }
public static string ToJson(this PoEObject self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);