Ejemplo n.º 1
0
        private void ShowExperience()
        {
            if (_host != null)
            {
                //If ExpTracker Window is enabled
                if (_host.get_Variable("ExpTracker.Window") == "1")
                {
                    //list for sorting
                    ArrayList sortList = new ArrayList();

                    //iterate through the list of all skills
                    foreach (DictionaryEntry sk in _skillList)
                    {
                        Skill skill = (Skill)sk.Value;
                        //for those that aren't at "clear" learning rate (0/34 )
                        if (skill.learningRate != "clear")
                        {
                            //add the skill + sort types to the list of items to be sorted
                            Sortskill sortSkill = new Sortskill
                            {
                                name = sk.Key.ToString(),
                                sortLR = ((Skill)sk.Value).sortLR,
                                sortLearning = ((Skill)sk.Value).iLearningRate
                            };
                            sortList.Add(sortSkill);
                        }
                    }
                    //Sort based on type of sort.  
                    //1: Reading sort 
                    if (_host.get_Variable("ExpTracker.SortType") == "1")
                        sortList.Sort(new MyComparerLR());
                    //2: By Learning Rate
                    else if (_host.get_Variable("ExpTracker.SortType") == "2")
                        sortList.Sort(new MyComparerLearning());
                    //3: By Learning Rate Reverse
                    else if (_host.get_Variable("ExpTracker.SortType") == "3")
                        sortList.Sort(new MyComparerLearningRev());
                    //0/Default: Alphabetical
                    else
                        sortList.Sort(new MyComparer());

                    //>=0 since if >0, when the last skill pulses to clear, 
                    //Exp window won'te update
                    if (sortList.Count >= 0)
                    {
                        //suspsend so it behaves as an update, not as a scrolling window
                        _host.SendText("#echo >Experience @suspend@");

                        //only echo the items that are in the sortList (non-clear learning rate)
                        foreach (Sortskill item in sortList)
                        {
                            //get the skill info from the hash table
                            Skill skill = (Skill)_skillList[item.name];
                            _host.SendText("#echo >Experience " + skill.output);
                        }

                        //tdp and sleep are blank in case there is no info for them to output
                        string tdp = "";
                        string asleep = "";

                        if (_startTDP < _TDP)
                            tdp = ";#echo >Experience TDP gained: " + (_TDP - _startTDP);
                        if (_host.get_Variable("ExpTracker.TrackSleep") == "1" && _host.get_Variable("ExpTracker.EchoSleep") == "1" && _host.get_Variable("ExpTracker.Sleeping") == "1")
                            if (_host.get_Variable("ExpTracker.Echo") == "")
                                asleep = ";#echo >Experience YOU ARE ASLEEP!";
                            else
                                asleep = ";#echo >Experience " + _host.get_Variable("ExpTracker.Echo");

                        TimeSpan oTimeSpan = DateTime.Now - _startTime;

                        //Short or long version of mindstate
                        string mindstatetext = "";
                        if (_host.get_Variable("ExpTracker.ShortNames") == "1")
                            mindstatetext = "Mindstate: ";
                        else
                            mindstatetext = "Overall state of mind: ";

                        _host.SendText("#echo >Experience " + mindstatetext + _mindState + asleep + tdp + ";#echo >Experience Last updated: $time;#echo >Experience Tracking for: " + FormatTimeSpan(oTimeSpan));
                        //resume so the updates actually show
                        _host.SendText("#echo >Experience @resume@");
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void DisplayReport()
        {
            //list for sorting
            ArrayList sortList = new ArrayList();

            //iterate through the list of all skills
            foreach (DictionaryEntry sk in _skillList)
            {
                Skill skill = (Skill)sk.Value;
                //add the skill + sort types to the list of items to be sorted
                if (skill.startRank - skill.rank != 0.0)
                {
                    Sortskill sortSkill = new Sortskill
                    {
                        name = sk.Key.ToString(),
                        sortLR = ((Skill)sk.Value).sortLR,
                        sortLearning = ((Skill)sk.Value).iLearningRate
                    };
                    sortList.Add(sortSkill);
                }
            }
            //Sort based on type of sort.  
            //1: Reading sort 
            if (_host.get_Variable("ExpTracker.SortType") == "1")
                sortList.Sort(new MyComparerLR());
            //2: By Learning Rate
            else if (_host.get_Variable("ExpTracker.SortType") == "2")
                sortList.Sort(new MyComparerLearning());
            //3: By Learning Rate Reverse
            else if (_host.get_Variable("ExpTracker.SortType") == "3")
                sortList.Sort(new MyComparerLearningRev());
            //0/Default: Alphabetical
            else
                sortList.Sort(new MyComparer());

            foreach (Sortskill item in sortList)
            {
                //get the skill info from the hash table
                Skill skill = (Skill)_skillList[item.name];
                _host.SendText("#echo " + skill.output);
            }
        }