bettola/srv/game/player.h

24 lines
525 B
C++

#pragma once
#include "bettola/network/socket.h"
class Player {
public:
Player(BettolaLib::Network::Socket* socket);
void set_position(float x, float y) { _x = x; _y = y; }
unsigned int get_id(void) const { return _id; }
float get_x(void) const { return _x; }
float get_y(void) const { return _y; }
BettolaLib::Network::Socket& get_socket(void) const { return *_socket; }
private:
static unsigned int _next_player_id;
unsigned int _id;
float _x;
float _y;
BettolaLib::Network::Socket* _socket;
};