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)); }
public Stats() { Profiles = new List<TrackedProfile>(); //note: this will change on first ProfileChanged call! string profileName = "none"; if (GlobalSettings.Instance.LastProfile != null) profileName = GlobalSettings.Instance.LastProfile; currentprofile = new TrackedProfile(profileName); Hero = FunkyGame.CurrentHeroName; }
public Stats() { Profiles = new List <TrackedProfile>(); //note: this will change on first ProfileChanged call! string profileName = "none"; if (GlobalSettings.Instance.LastProfile != null) { profileName = GlobalSettings.Instance.LastProfile; } currentprofile = new TrackedProfile(profileName); Hero = FunkyGame.CurrentHeroName; }
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); }
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 && currentprofile.ProfileName != sThisProfile) { //Refresh Profile Target Blacklist FunkyGame.Profile.UpdateProfileBlacklist(); //Set the "end" date for current profile currentprofile.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]; } else {//Reorder the profiles! int previousProfileIndex = Profiles.IndexOf(currentprofile); //Copy profiles TrackedProfile[] clone_profiles = new TrackedProfile[Profiles.Count]; Profiles.CopyTo(clone_profiles, 0); //Reorder.. for (int i = previousProfileIndex; i < Profiles.Count - 1; i++) { Profiles[i] = clone_profiles[i+1]; } //Finally Set the last profile to current! Profiles[Profiles.Count - 1] = currentprofile; } WriteProfileTrackerOutput(ref FunkyGame.CurrentStats); } }
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 && currentprofile.ProfileName != sThisProfile) { //Refresh Profile Target Blacklist FunkyGame.Profile.UpdateProfileBlacklist(); //Set the "end" date for current profile currentprofile.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]; } else {//Reorder the profiles! int previousProfileIndex = Profiles.IndexOf(currentprofile); //Copy profiles TrackedProfile[] clone_profiles = new TrackedProfile[Profiles.Count]; Profiles.CopyTo(clone_profiles, 0); //Reorder.. for (int i = previousProfileIndex; i < Profiles.Count - 1; i++) { Profiles[i] = clone_profiles[i + 1]; } //Finally Set the last profile to current! Profiles[Profiles.Count - 1] = currentprofile; } WriteProfileTrackerOutput(ref FunkyGame.CurrentStats); } }