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);
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 public static string ToJson(this PoEObject self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);