MCPcopy Create free account
hub / github.com/ddnet/ddnet / CurrentCommunities

Method CurrentCommunities

src/engine/client/serverbrowser.cpp:1815–1832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1813}
1814
1815std::vector<const CCommunity *> CServerBrowser::CurrentCommunities() const
1816{
1817 if(m_ServerlistType == IServerBrowser::TYPE_INTERNET || m_ServerlistType == IServerBrowser::TYPE_FAVORITES)
1818 {
1819 return SelectedCommunities();
1820 }
1821 else if(m_ServerlistType >= IServerBrowser::TYPE_FAVORITE_COMMUNITY_1 && m_ServerlistType <= IServerBrowser::TYPE_FAVORITE_COMMUNITY_5)
1822 {
1823 const size_t CommunityIndex = m_ServerlistType - IServerBrowser::TYPE_FAVORITE_COMMUNITY_1;
1824 std::vector<const CCommunity *> vpFavoriteCommunities = FavoriteCommunities();
1825 dbg_assert(CommunityIndex < vpFavoriteCommunities.size(), "Invalid favorite community serverbrowser type");
1826 return {vpFavoriteCommunities[CommunityIndex]};
1827 }
1828 else
1829 {
1830 return {};
1831 }
1832}
1833
1834unsigned CServerBrowser::CurrentCommunitiesHash() const
1835{

Callers 1

UpdateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected