Esempio n. 1
0
 protected UnitCluster()
     : base()
 {
     ListUnits = new List<CacheUnit>();
     //UnitMobileCounter=0;
     NearestMonsterDistance = -1f;
     Info = new ClusterInfo();
 }
Esempio n. 2
0
        }          // of overloaded constructor

        public UnitCluster(double p_Dist, CacheUnit unit)
            : base(p_Dist, unit)
        {
            ListUnits = new List <CacheUnit>();
            ListUnits.Add(unit);
            NearestMonsterDistance = unit.CentreDistance;
            Info = new ClusterInfo();
            Info.Update(ref unit);
        }          // of overloaded constructor
Esempio n. 3
0
 public UnitCluster(double p_Dist, CacheUnit unit)
     : base(p_Dist, unit)
 {
     ListUnits = new List<CacheUnit>();
     ListUnits.Add(unit);
     NearestMonsterDistance = unit.CentreDistance;
     Info = new ClusterInfo();
     Info.Update(ref unit);
 }
Esempio n. 4
0
        public void Merge(ClusterInfo other)
        {
            this.UnitCounter += other.UnitCounter;
            this.WeakCounter += other.WeakCounter;
            this.StrongCounter += other.StrongCounter;
            this.ElitesCounter += other.ElitesCounter;
            this.FastCounter += other.FastCounter;
            this.RangedCounter += other.RangedCounter;
            this.DOTDPSCounter += other.DOTDPSCounter;
            this.BossCounter += other.BossCounter;

            UpdateProperties();
        }
Esempio n. 5
0
        public void Merge(ClusterInfo other)
        {
            this.UnitCounter   += other.UnitCounter;
            this.WeakCounter   += other.WeakCounter;
            this.StrongCounter += other.StrongCounter;
            this.ElitesCounter += other.ElitesCounter;
            this.FastCounter   += other.FastCounter;
            this.RangedCounter += other.RangedCounter;
            this.DOTDPSCounter += other.DOTDPSCounter;
            this.BossCounter   += other.BossCounter;

            UpdateProperties();
        }
Esempio n. 6
0
        public void UpdateUnitPointLists(ClusterConditions CC)
        {
            if (ListUnits.Count == 0) return;

            List<int> RemovalIndexList = new List<int>();
            bool changeOccured = false;
            foreach (var item in ListUnits)
            {
                if (!item.IsStillValid() || (!CC.IgnoreNonTargetable || !item.IsTargetable.Value))
                {
                    RemovalIndexList.Add(ListUnits.IndexOf(item));
                    RAGUIDS.Remove(item.RAGUID);
                    changeOccured = true;
                }
            }

            if (changeOccured)
            {
                RemovalIndexList.Sort();
                RemovalIndexList.Reverse();
                foreach (var item in RemovalIndexList)
                {
                    //ListCacheObjects.RemoveAt(item);
                    ListUnits.RemoveAt(item);
                    ListPoints.RemoveAt(item);
                }

                if (ListUnits.Count > 1)
                {
                    //Logger.DBLog.InfoFormat("Updating Cluster");

                    //Reset Vars
                    Info = new ClusterInfo();

                    NearestMonsterDistance = -1f;

                    //Set default using First Unit
                    CacheUnit firstUnit = ListUnits[0];
                    MidPoint = firstUnit.PointPosition;
                    RAGUIDS.Add(firstUnit.RAGUID);
                    NearestMonsterDistance = firstUnit.CentreDistance;
                    Info.Update(ref firstUnit);

                    //Iterate thru the remaining
                    for (int i = 1; i < ListUnits.Count - 1; i++)
                    {
                        this.UpdateProperties(ListUnits[i]);
                    }
                }

            }
        }