1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| class Network
{
public:
Network(sf::IpAddress join);
Network(const Network&) = delete;
virtual ~Network();
private:
// ATTENTION, les initialisations sont faites dans l'ordre
// de leurs declarations dans la classe, donc mettre le
// champ modifiable en premier
std::map<ServerId, std::unique_ptr<sf::TcpSocket>> m_otherServers;
const ServerId m_id = 1;
static ServerId doConnectToIP(std::map& serverList, sf::IpAddress join);
};
Network::Network(sf::IpAddress join)
: m_otherServers()
, m_id(doConnectToIP(m_otherServers, join)
{
} |