18 #ifndef HEADER_SUPERTUX_ADDON_ADDON_HPP 19 #define HEADER_SUPERTUX_ADDON_ADDON_HPP 30 static std::unique_ptr<Addon> parse(
const ReaderMapping& mapping);
31 static std::unique_ptr<Addon> parse(
const std::string& fname);
33 enum Type { WORLD, WORLDMAP, LEVELSET, LANGUAGEPACK, RESOURCEPACK, ADDON };
47 std::string m_license;
51 std::string m_description;
54 std::vector<std::string> m_screenshots;
55 std::vector<std::string> m_dependencies;
58 std::string m_install_filename;
65 const std::string& get_id()
const {
return m_id; }
66 int get_version()
const {
return m_version; }
67 int get_format()
const {
return m_format; }
69 Type get_type()
const {
return m_type; }
70 const std::string& get_title()
const {
return m_title; }
71 const std::string& get_author()
const {
return m_author; }
72 const std::string& get_license()
const {
return m_license; }
74 const std::string& get_description()
const {
return m_description; }
75 const std::string& get_url()
const {
return m_url; }
76 const std::string& get_md5()
const {
return m_md5; }
77 const std::vector<std::string>& get_screenshots()
const {
return m_screenshots; }
78 const std::vector<std::string>& get_dependencies()
const {
return m_dependencies; }
80 std::string get_filename()
const;
81 const std::string& get_install_filename()
const;
83 bool is_installed()
const;
84 bool is_enabled()
const;
85 bool is_visible()
const;
87 bool is_levelset()
const;
88 bool overrides_data()
const;
89 bool requires_restart()
const;
91 void set_install_filename(
const std::string& absolute_filename,
const std::string& md5);
92 void set_enabled(
bool v);
100 Addon::Type addon_type_from_string(
const std::string& type);
101 std::string addon_type_to_translated_string(Addon::Type type);
102 std::string generate_menu_item_text(
const Addon& addon);
103 std::string get_addon_plural_form(
size_t count);
Definition: reader_mapping.hpp:32