-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
34 lines (26 loc) · 816 Bytes
/
Player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Created by Piotr Kamiński on 22/05/2022.
//
#ifndef BOMBERMANSERVER_PLAYER_H
#define BOMBERMANSERVER_PLAYER_H
#include <iostream>
#include <utility>
#include "types.h"
#include "common.h"
#include "Position.h"
namespace bomberman {
struct Player {
string playerName;
string playerAddress;
string buffer;
Player() = default;
explicit Player(socket_t &socket) {
playerName = read_string(socket);
playerAddress = read_string(socket);
}
Player(string name, string address) : playerName(std::move(name)), playerAddress(std::move(address)) {}
};
using players_t = std::unordered_map<player_id_t, Player>;
using players_position_t = std::unordered_map<player_id_t, Position>;
}
#endif //BOMBERMANSERVER_PLAYER_H