28 TypeInfo(
const std::string &n, ObjectType ot = ObjectType::INVALID)
29 : name(n), name_pl(name +
"s"), object_type(ot)
32 TypeInfo(
const std::string &n,
const std::string &n_pl, ObjectType ot = ObjectType::INVALID)
33 : name(n), name_pl(n_pl), object_type(ot)
36 const std::string name;
37 const std::string name_pl;
38 const ObjectType object_type;
41 static const std::map<Type, TypeInfo> &get_type_info();
42 static const TypeInfo &get_type_info(Type type);
46 void set_query(
const std::string &q);
47 bool is_valid()
const;
48 const std::string &get_query()
const;
49 bool matches(
const std::string &haystack)
const;
51 std::pair<Coordf, Coordf> area_visible;
70 UUIDVec instance_path;
71 bool selectable =
false;
74 virtual std::list<SearchResult> search(
const SearchQuery &q) = 0;
75 virtual std::set<Type> get_types()
const = 0;
76 virtual std::string get_display_name(
const SearchResult &r) = 0;
83 void sort_search_results(std::list<SearchResult> &results,
const SearchQuery &q);