mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add player names display
This commit is contained in:
parent
acc4d2540d
commit
65e5063326
10 changed files with 80 additions and 16 deletions
|
|
@ -11,7 +11,7 @@ void Players::addPlayer(std::unique_ptr<Player> player) {
|
|||
players[player->getId()] = std::move(player);
|
||||
}
|
||||
|
||||
Player* Players::getPlayer(int64_t id) const {
|
||||
Player* Players::get(int64_t id) const {
|
||||
const auto& found = players.find(id);
|
||||
if (found == players.end()) {
|
||||
return nullptr;
|
||||
|
|
|
|||
|
|
@ -21,11 +21,19 @@ class Players : public Serializable {
|
|||
public:
|
||||
Players(Level* level);
|
||||
|
||||
Player* getPlayer(int64_t id) const;
|
||||
Player* get(int64_t id) const;
|
||||
|
||||
Player* create();
|
||||
|
||||
dv::value serialize() const override;
|
||||
|
||||
void deserialize(const dv::value& src) override;
|
||||
|
||||
auto begin() const {
|
||||
return players.begin();
|
||||
}
|
||||
|
||||
auto end() const {
|
||||
return players.end();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue