22#ifndef HEADER_REMOTE_KART_INFO_HPP
23#define HEADER_REMOTE_KART_INFO_HPP
25#include "network/kart_data.hpp"
52 std::string m_kart_name;
53 irr::core::stringw m_user_name;
54 int m_local_player_id;
55 int m_global_player_id;
58 bool m_network_player;
60 float m_default_kart_color;
62 std::string m_country_code;
63 std::weak_ptr<NetworkPlayerProfile> m_profile;
67 const irr::core::stringw& user_name, uint32_t host_id,
69 : m_kart_name(kart_name), m_user_name(user_name),
70 m_local_player_id(player_id), m_global_player_id(-1),
71 m_host_id(host_id), m_kart_team(KART_TEAM_NONE),
72 m_network_player(network),
73 m_handicap(HANDICAP_NONE),
74 m_default_kart_color(0.0f), m_online_id(0)
76 RemoteKartInfo(
const std::string& kart_name) : m_kart_name(kart_name),
77 m_user_name(
""), m_local_player_id(-1),
78 m_global_player_id(-1),
79 m_host_id(std::numeric_limits<uint32_t>::max()),
80 m_kart_team(KART_TEAM_NONE), m_network_player(
false),
81 m_handicap(HANDICAP_NONE),
82 m_default_kart_color(0.0f), m_online_id(0)
85 m_local_player_id(-1), m_global_player_id(-1),
86 m_host_id(std::numeric_limits<uint32_t>::max()),
87 m_kart_team(KART_TEAM_NONE), m_network_player(
false),
88 m_handicap(HANDICAP_NONE),
89 m_default_kart_color(0.0f), m_online_id(0)
91 void setKartName(
const std::string& n) { m_kart_name = n; }
92 void setPlayerName(
const irr::core::stringw& u) { m_user_name = u; }
93 void setHostId(uint32_t
id) { m_host_id = id; }
94 void setLocalPlayerId(
int id) { m_local_player_id = id; }
95 void setGlobalPlayerId(
int id) { m_global_player_id = id; }
96 void setKartTeam(KartTeam team) { m_kart_team = team; }
97 void setNetworkPlayer(
bool value) { m_network_player = value; }
98 void setDefaultKartColor(
float value) { m_default_kart_color = value; }
100 void setOnlineId(uint32_t
id) { m_online_id = id; }
101 uint32_t getHostId()
const {
return m_host_id; }
102 int getLocalPlayerId()
const {
return m_local_player_id; }
103 int getGlobalPlayerId()
const {
return m_global_player_id; }
104 bool isNetworkPlayer()
const {
return m_network_player; }
105 const std::string& getKartName()
const {
return m_kart_name; }
106 const irr::core::stringw& getPlayerName()
const {
return m_user_name; }
107 KartTeam getKartTeam()
const {
return m_kart_team; }
109 float getDefaultKartColor()
const {
return m_default_kart_color; }
110 uint32_t getOnlineId()
const {
return m_online_id; }
111 void setCountryCode(
const std::string&
id) { m_country_code = id; }
112 const std::string& getCountryCode()
const {
return m_country_code; }
113 void setKartData(
const KartData& data) { m_kart_data = data; }
114 const KartData& getKartData()
const {
return m_kart_data; }
115 void setNetworkPlayerProfile(
116 std::weak_ptr<NetworkPlayerProfile> npp) { m_profile = npp; }
117 std::weak_ptr<NetworkPlayerProfile> getNetworkPlayerProfile()
const
118 {
return m_profile; }
119 bool disconnected()
const {
return m_profile.expired(); }
120 bool isReserved()
const
121 {
return m_host_id == std::numeric_limits<uint32_t>::max(); }
124 m_host_id = std::numeric_limits<uint32_t>::max();
127 void copyFrom(std::shared_ptr<NetworkPlayerProfile> p,
131 return ((m_host_id<other.m_host_id) ||
132 (m_host_id==other.m_host_id && m_local_player_id<other.m_local_player_id));
136typedef std::vector<RemoteKartInfo> RemoteKartInfoList;
Definition: kart_data.hpp:12
Contains the profile of a player.
Definition: network_player_profile.hpp:42
Definition: remote_kart_info.hpp:51
HandicapLevel
Handicap per player.
Definition: remote_kart_info.hpp:42