Cosmetic changes (added comments etc).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10091 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -38,20 +38,26 @@ class KartPropertiesManager: public NoCopy
|
||||
private:
|
||||
/** The list of all directories in which to search for karts. */
|
||||
static std::vector<std::string> m_kart_search_path;
|
||||
|
||||
/** All directories from which karts were loaded. Needed by unlock_manager
|
||||
* to load all challenges. */
|
||||
std::vector<std::string> m_all_kart_dirs;
|
||||
|
||||
/** List of all kart groups. */
|
||||
std::vector<std::string> m_all_groups;
|
||||
|
||||
/** Mapping of group names to list of kart indices in each group. */
|
||||
std::map<std::string, std::vector<int> > m_groups;
|
||||
|
||||
/** Vector containing kart numbers that have been selected in multiplayer
|
||||
* games. This it used to ensure the same kart can not be selected more
|
||||
* than once. */
|
||||
std::vector<int> m_selected_karts;
|
||||
|
||||
/** Contains a flag for each kart indicating wether it is available on
|
||||
* all clients or not. */
|
||||
std::vector<bool> m_kart_available;
|
||||
|
||||
bool loadKart(const std::string &dir);
|
||||
protected:
|
||||
|
||||
@@ -62,36 +68,49 @@ protected:
|
||||
public:
|
||||
KartPropertiesManager();
|
||||
~KartPropertiesManager();
|
||||
static void addKartSearchDir (const std::string &s);
|
||||
static void addKartSearchDir (const std::string &s);
|
||||
const KartProperties* getKartById (int i) const;
|
||||
const KartProperties* getKart (const std::string &ident) const;
|
||||
const int getKartId (const std::string &ident) const;
|
||||
int getKartByGroup (const std::string& group, int i) const;
|
||||
const KartProperties* getKart(const std::string &ident) const;
|
||||
const int getKartId(const std::string &ident) const;
|
||||
int getKartByGroup(const std::string& group,
|
||||
int i) const;
|
||||
|
||||
void loadAllKarts (bool loading_icon = true);
|
||||
void unloadAllKarts ();
|
||||
void reLoadAllKarts ();
|
||||
|
||||
const unsigned int getNumberOfKarts () const {return (unsigned int)m_karts_properties.size();}
|
||||
const std::vector<std::string>&
|
||||
getAllGroups () const {return m_all_groups; }
|
||||
const std::vector<int> getKartsInGroup (const std::string& g);
|
||||
void clearAllSelectedKarts() {m_selected_karts.clear();}
|
||||
void removeLastSelectedKart() {m_selected_karts.pop_back();}
|
||||
int getNumSelectedKarts() const {return m_selected_karts.size();}
|
||||
bool kartAvailable(int kartid);
|
||||
std::vector<std::string> getAllAvailableKarts() const;
|
||||
void setUnavailableKarts(std::vector<std::string>);
|
||||
/** Sets a kartid to be selected (without any tests). */
|
||||
void selectKart(int kartid) {m_selected_karts.push_back(kartid);}
|
||||
void selectKartName(const std::string &kart_name);
|
||||
bool testAndSetKart(int kartid);
|
||||
void getRandomKartList(int count,
|
||||
RemoteKartInfoList& existing_karts,
|
||||
std::vector<std::string> *ai_list);
|
||||
RemoteKartInfoList& existing_karts,
|
||||
std::vector<std::string> *ai_list);
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns a list of all groups. */
|
||||
const std::vector<std::string>& getAllGroups() const {return m_all_groups;}
|
||||
// ------------------------------------------------------------------------
|
||||
/** Clears all selected karts (used in networking only). */
|
||||
void clearAllSelectedKarts() { m_selected_karts.clear(); }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Removed the last selected kart (used in networking only). */
|
||||
void removeLastSelectedKart() { m_selected_karts.pop_back(); }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the number of selected karts (used in networking only). */
|
||||
int getNumSelectedKarts() const { return m_selected_karts.size(); }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Sets a kartid to be selected (used in networking only). */
|
||||
void selectKart(int kartid) { m_selected_karts.push_back(kartid); }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns all directories from which karts were loaded. */
|
||||
const std::vector<std::string>* getAllKartDirs() const
|
||||
{ return &m_all_kart_dirs; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the number of karts. */
|
||||
const unsigned int getNumberOfKarts() const {
|
||||
return (unsigned int)m_karts_properties.size();
|
||||
} // getNumberOfKarts
|
||||
};
|
||||
|
||||
extern KartPropertiesManager *kart_properties_manager;
|
||||
|
||||
Reference in New Issue
Block a user