* Added Player class to represent players on the server. * Added Game class to manage the overall game state. * Server now adds new players to the game state when they connect. * Server now updates the players position in the game state on receiving a PlayerPosMessage.
18 lines
333 B
C++
18 lines
333 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; }
|
|
|
|
BettolaLib::Network::Socket& get_socket(void) const { return *_socket; }
|
|
|
|
private:
|
|
float _x;
|
|
float _y;
|
|
BettolaLib::Network::Socket* _socket;
|
|
};
|