2 #include "common/common.hpp"
3 #include "util/uuid_path.hpp"
27 TypeInfo(
const std::string &n, ObjectType ot = ObjectType::INVALID)
28 : name(n), name_pl(name +
"s"), object_type(ot)
31 TypeInfo(
const std::string &n,
const std::string &n_pl, ObjectType ot = ObjectType::INVALID)
32 : name(n), name_pl(n_pl), object_type(ot)
35 const std::string name;
36 const std::string name_pl;
37 const ObjectType object_type;
40 static const std::map<Type, TypeInfo> &get_type_info();
41 static const TypeInfo &get_type_info(Type type);
45 void set_query(
const std::string &q);
46 const std::string &get_query()
const;
47 bool contains(
const std::string &haystack)
const;
49 std::pair<Coordf, Coordf> area_visible;
67 bool selectable =
false;
70 virtual std::list<SearchResult> search(
const SearchQuery &q) = 0;
71 virtual std::set<Type> get_types()
const = 0;
72 virtual std::string get_display_name(
const SearchResult &r) = 0;
79 void sort_search_results(std::list<SearchResult> &results,
const SearchQuery &q);