QTfrontend/model/MapModel.h
changeset 6943 1fe601a2761b
parent 6939 970389573788
child 6947 1be3e48e1d53
equal deleted inserted replaced
6942:11f52445e8cd 6943:1fe601a2761b
    52             HandDrawnMap,
    52             HandDrawnMap,
    53             MissionMap,
    53             MissionMap,
    54             StaticMap
    54             StaticMap
    55         };
    55         };
    56 
    56 
       
    57         /// a struct for holding the attributes of a map.
    57         struct MapInfo
    58         struct MapInfo
    58         {
    59         {
    59             MapType type;
    60             MapType type; ///< The map-type
    60             QString name;
    61             QString name; ///< The internal name.
    61             QString theme;
    62             QString theme; ///< The theme to be used. (can be empty)
    62             quint32 limit;
    63             quint32 limit; ///< The maximum allowed number of hedgehogs.
    63             QString scheme;
    64             QString scheme; ///< Default scheme name or "locked", for mission-maps.
    64             QString weapons;
    65             QString weapons; ///< Default weaponset name or "locked", for missions-maps.
    65         };
    66         };
    66 
    67 
       
    68         /**
       
    69          * @brief Returns the number of available mission maps.
       
    70          * @return mission map count.
       
    71          */
    67         int missionCount() const;
    72         int missionCount() const;
    68 
    73 
    69 
    74 
    70     public slots:
    75     public slots:
    71         /// reloads the maps from the DataManager
    76         /// reloads the maps using the DataManager
    72         void loadMaps();
    77         void loadMaps();
    73 
    78 
    74 
    79 
    75     private:
    80     private:
    76         int m_nMissions;
    81         int m_nMissions; ///< used to keep track of the mission amount
    77 
    82 
       
    83         /**
       
    84          * @brief Creates a QStandardItem, that holds the map info and item appearance.
       
    85          * The used role for the data is Qt::UserRole + 1.
       
    86          * @param icon the icon to be displayed (can be an empty QIcon()).
       
    87          * @param caption the text to be displayed.
       
    88          * @param type the type of the map.
       
    89          * @param name the internal name of the map.
       
    90          * @param theme the theme of the map (or empty if none).
       
    91          * @param limit the hedgehog limit of the map.
       
    92          * @param scheme mission map: default scheme name or "locked".
       
    93          * @param weapons mission map: default weaponset name or "locked".
       
    94          * @return pointer to item representing the map info: at Qt::UserRole + 1.
       
    95          */
    78         QStandardItem * infoToItem(
    96         QStandardItem * infoToItem(
    79             const QIcon & icon,
    97             const QIcon & icon,
    80             const QString caption,
    98             const QString caption,
    81             MapType type = Invalid,
    99             MapType type = Invalid,
    82             QString name = "",
   100             QString name = "",