Esempio n. 1
0
 public GameStats()
 {
     Profiles = new List<TrackedProfile>();
     MonsterPower = Bot.Settings.Demonbuddy.EnableDemonBuddyCharacterSettings ? Bot.Settings.Demonbuddy.MonsterPower : Funky.iDemonbuddyMonsterPowerLevel;
     //note: this will change on first ProfileChanged call!
     currentprofile = new TrackedProfile(GlobalSettings.Instance.LastProfile);
 }
Esempio n. 2
0
 public GameStats()
 {
     Profiles     = new List <TrackedProfile>();
     MonsterPower = Bot.Settings.Demonbuddy.EnableDemonBuddyCharacterSettings ? Bot.Settings.Demonbuddy.MonsterPower : Funky.iDemonbuddyMonsterPowerLevel;
     //note: this will change on first ProfileChanged call!
     currentprofile = new TrackedProfile(GlobalSettings.Instance.LastProfile);
 }
Esempio n. 3
0
 ///<summary>
 ///Adds the sum of each property of the given TrackedProfile to this instance.
 ///</summary>
 public void MergeStats(TrackedProfile other)
 {
     TotalGold    += other.TotalGold;
     TotalXP      += other.TotalXP;
     DeathCount   += other.DeathCount;
     TotalTimeSpan = TotalTimeSpan.Add(other.TotalTimeSpan);
     LootTracker.Merge(other.LootTracker);
 }
Esempio n. 4
0
 public static bool Equals(TrackedProfile P, string name)
 {
     //Check for null and compare run-time types.
     if (P == null)
     {
         return false;
     }
     return P.ProfileName.Equals(name);
 }
Esempio n. 5
0
 public static bool Equals(TrackedProfile P, string name)
 {
     //Check for null and compare run-time types.
     if (P == null)
     {
         return(false);
     }
     return(P.ProfileName.Equals(name));
 }
Esempio n. 6
0
        public void ProfileChanged(string sThisProfile)
        {
            //fresh profile?
            if (Profiles.Count == 0)
            {
                //Lets create a new profile
                Profiles.Add(new TrackedProfile(sThisProfile));

                //Reference it to the Collection
                currentprofile = Profiles[Profiles.Count - 1];
            }

            //Did we really change profiles?
            if (Profiles.Count > 0 && Profiles.Last().ProfileName != sThisProfile)
            {
                //Refresh Profile Target Blacklist
                BlacklistCache.UpdateProfileBlacklist();

                //Set the "end" date for current profile
                Profiles.Last().UpdateRangeVariables();



                bool foundPreviousEntry = false;
                foreach (TrackedProfile item in Profiles)
                {
                    //Found the profile so lets use that instead!
                    if (item.ProfileName == sThisProfile)
                    {
                        foundPreviousEntry = true;
                        item.RestartRangeVariables();                        //reset Starting variables

                        //Reference it to the Collection
                        currentprofile = item;
                        break;
                    }
                }


                //Profile was not found.. so lets add it and set it as current.
                if (!foundPreviousEntry)
                {
                    //Lets create a new profile
                    Profiles.Add(new TrackedProfile(sThisProfile));
                    //Reference it to the Collection
                    currentprofile = Profiles[Profiles.Count - 1];
                }
            }
        }
Esempio n. 7
0
        public void ProfileChanged(string sThisProfile)
        {
            //fresh profile?
            if (Profiles.Count == 0)
            {
                //Lets create a new profile
                Profiles.Add(new TrackedProfile(sThisProfile));

                //Reference it to the Collection
                currentprofile = Profiles[Profiles.Count - 1];
            }

            //Did we really change profiles?
            if (Profiles.Count > 0 && Profiles.Last().ProfileName != sThisProfile)
            {
                //Refresh Profile Target Blacklist
                BlacklistCache.UpdateProfileBlacklist();

                //Set the "end" date for current profile
                Profiles.Last().UpdateRangeVariables();

                bool foundPreviousEntry = false;
                foreach (TrackedProfile item in Profiles)
                {
                    //Found the profile so lets use that instead!
                    if (item.ProfileName == sThisProfile)
                    {
                        foundPreviousEntry = true;
                        item.RestartRangeVariables();//reset Starting variables

                        //Reference it to the Collection
                        currentprofile = item;
                        break;
                    }
                }

                //Profile was not found.. so lets add it and set it as current.
                if (!foundPreviousEntry)
                {
                    //Lets create a new profile
                    Profiles.Add(new TrackedProfile(sThisProfile));
                    //Reference it to the Collection
                    currentprofile = Profiles[Profiles.Count - 1];
                }
            }
        }
Esempio n. 8
0
 ///<summary>
 ///Adds the sum of each property of the given TrackedProfile to this instance.
 ///</summary>
 public void MergeStats(TrackedProfile other)
 {
     TotalGold += other.TotalGold;
     TotalXP += other.TotalXP;
     DeathCount += other.DeathCount;
     TotalTimeSpan = TotalTimeSpan.Add(other.TotalTimeSpan);
     LootTracker.Merge(other.LootTracker);
 }