64 QString scheme; ///< Default scheme name or "locked", for mission-maps. |
64 QString scheme; ///< Default scheme name or "locked", for mission-maps. |
65 QString weapons; ///< Default weaponset name or "locked", for missions-maps. |
65 QString weapons; ///< Default weaponset name or "locked", for missions-maps. |
66 }; |
66 }; |
67 |
67 |
68 /** |
68 /** |
69 * @brief Returns the number of available mission maps. |
69 * @brief Returns the number of available maps of a specified type. |
70 * @return mission map count. |
70 * @param type map type to get the count of. |
|
71 * @return count of maps that have the specified type. |
71 */ |
72 */ |
72 int missionCount() const; |
73 int mapCount(MapType type) const; |
|
74 |
|
75 /** |
|
76 * @brief Returns the row-index of a random map with a specified type. |
|
77 * @param type desired type of map. |
|
78 * @return row-index of a map with the desired type, -1 if none found. |
|
79 */ |
|
80 int randomMap(MapType type) const; |
73 |
81 |
74 |
82 |
75 public slots: |
83 public slots: |
76 /// reloads the maps using the DataManager |
84 /// reloads the maps using the DataManager |
77 void loadMaps(); |
85 void loadMaps(); |
78 |
86 |
79 |
87 |
80 private: |
88 private: |
81 int m_nMissions; ///< used to keep track of the mission amount |
89 ///< start-index and map count for each map-type |
|
90 QMap<MapType, QPair<int,int> > typeLoc; |
82 |
91 |
83 /** |
92 /** |
84 * @brief Creates a QStandardItem, that holds the map info and item appearance. |
93 * @brief Creates a QStandardItem, that holds the map info and item appearance. |
85 * The used role for the data is Qt::UserRole + 1. |
94 * The used role for the data is Qt::UserRole + 1. |
86 * @param icon the icon to be displayed (can be an empty QIcon()). |
95 * @param icon the icon to be displayed (can be an empty QIcon()). |