2019-01-23 00:04:03 +01:00
|
|
|
/*
|
|
|
|
* =====================================================================================
|
|
|
|
*
|
|
|
|
* Filename: Player.hpp
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
*
|
|
|
|
* Created: 22/01/2019 23:46:45
|
|
|
|
*
|
|
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
|
|
|
*
|
|
|
|
* =====================================================================================
|
|
|
|
*/
|
|
|
|
#ifndef PLAYER_HPP_
|
|
|
|
#define PLAYER_HPP_
|
|
|
|
|
|
|
|
#include "Inventory.hpp"
|
|
|
|
#include "ISerializable.hpp"
|
|
|
|
|
|
|
|
class Player : public ISerializable {
|
|
|
|
public:
|
|
|
|
void serialize(sf::Packet &packet) override;
|
|
|
|
void deserialize(sf::Packet &packet) override;
|
|
|
|
|
2019-03-17 16:56:26 +01:00
|
|
|
s32 x() const { return m_x; }
|
|
|
|
s32 y() const { return m_y; }
|
2019-04-07 17:20:35 +02:00
|
|
|
s32 z() const { return m_z; }
|
2019-03-17 16:56:26 +01:00
|
|
|
|
2019-01-23 00:04:03 +01:00
|
|
|
Inventory &inventory() { return m_inventory; }
|
|
|
|
|
2019-04-07 17:20:35 +02:00
|
|
|
void setPosition(s32 x, s32 y, s32 z) { m_x = x; m_y = y; m_z = z; }
|
|
|
|
|
2019-01-23 00:04:03 +01:00
|
|
|
protected:
|
2019-03-17 16:56:26 +01:00
|
|
|
s32 m_x = 0;
|
|
|
|
s32 m_y = 0;
|
2019-04-07 17:20:35 +02:00
|
|
|
s32 m_z = 0;
|
2019-03-17 16:56:26 +01:00
|
|
|
|
2019-01-23 00:04:03 +01:00
|
|
|
Inventory m_inventory{9, 4};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PLAYER_HPP_
|