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 bool is_valid()
const;
47 const std::string &get_query()
const;
48 bool matches(
const std::string &haystack)
const;
50 std::pair<Coordf, Coordf> area_visible;
69 bool selectable =
false;
72 virtual std::list<SearchResult> search(
const SearchQuery &q) = 0;
73 virtual std::set<Type> get_types()
const = 0;
74 virtual std::string get_display_name(
const SearchResult &r) = 0;
81 void sort_search_results(std::list<SearchResult> &results,
const SearchQuery &q);