3/////////////////////////////////////////////////
4template <typename LayoutType>
5bool Layout::has (const std::string& entry) const
7 const auto end = std::string::npos;
8 for (const auto& set : m_setFilenames) {
9 for (const auto& key : m_layoutEntries.at (set)) {
10 if (key.find (layoutTypeName <LayoutType> ()) != end && key.find (entry) != end) {
18/////////////////////////////////////////////////
19template <typename LayoutType>
20LayoutType& Layout::get (
21 const std::string& entry,
24 return const_cast <LayoutType&> (std::as_const (*this).get <LayoutType> (entry, addLayoutType));
27/////////////////////////////////////////////////
28template <typename LayoutType>
29const LayoutType& Layout::get (
30 const std::string& entry,
31 bool addLayoutType) const
33 // get key. We need these two cases for serialization ease
36 key = layoutTypeName <LayoutType> () + entry;
39 // return requested entry
40 if constexpr (std::is_same_v <LayoutType, Panel>) {
41 return m_entries.at (key).panel;
42 } else if constexpr (std::is_same_v <LayoutType, sf::Vector2f>) {
43 return m_entries.at (key).position;
44 } else if constexpr (std::is_same_v <LayoutType, Window>) {
45 return m_entries.at (key).window;
47 return m_entries.at (key).constraints;