#ifndef SONGROOT
#define SONGROOT
#include "entry.h"
class songroot
{
   public:
      apstring title;
      apstring mode;
      entry* head;

      void sort();
         //sorts all songs under this->head by EX score in descending order

      void rank();
         //assuming the song is sorted by score already, think function ranks
         //players (1st, 2nd, 3rd, etc.) and assigns a percentile to their entry.
         //percentiles range from 1 to 0, and signify the fraction of opponents
         //within that particular song with a lower score.
         //1st place gets 1, last place gets 0, the rest are spaced out evenly between.

      bool operator< (const songroot &rhs);
         //lessthan operator for songroot. Compares title. Compares mode if
         //title is the same. Passes off work to apstring's operator< function.

      inline bool operator== (songroot &rhs) {if(title==rhs.title) return mode==rhs.mode;
                                                                  return title==rhs.title;};
         //equality operator for songroot. Compares title. Compares mode if
         //title is the same. Passes off work to apstring's operator== function.

      inline bool operator!= (songroot &rhs) {if(title!=rhs.title) return mode!=rhs.mode;
                                                                  return title!=rhs.title;};
         //inequality operator for songroot. Compares title. Compares mode if
         //title is the same. Passes off work to apstring's operator!= function.

      inline ostream& operator<< (ostream &out)
                                 {out<<title<<" "<<mode; return out;};
         //output stream operator for songroot.

   private:
      int modeconversion(apstring &givenmode);//sorts difficulties by their true order
      apstring caps(apstring input);//converts string to uppercase
};

#include "songroot.cpp"
#endif