2016-03-25 17:40:39 +00:00
|
|
|
#ifndef __PTF_PLAYER_HPP__
|
|
|
|
#define __PTF_PLAYER_HPP__
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
#include <SFML/Graphics.hpp>
|
2016-03-15 16:08:21 +00:00
|
|
|
#include "object.hpp"
|
2016-03-04 15:29:31 +00:00
|
|
|
|
2016-03-25 17:40:39 +00:00
|
|
|
class Player : public Object {
|
2016-03-15 16:08:21 +00:00
|
|
|
private:
|
2016-03-28 15:23:47 +00:00
|
|
|
mutable sf::Sprite sprite;
|
2016-03-25 17:40:39 +00:00
|
|
|
unsigned int player_number;
|
2016-03-10 20:47:19 +00:00
|
|
|
|
2016-03-15 16:08:21 +00:00
|
|
|
protected:
|
2016-03-08 18:50:21 +00:00
|
|
|
/**
|
|
|
|
* Calcule les forces appliquées à l'objet
|
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
virtual sf::Vector2f getForces(const Manager& manager, const std::vector<Object*>& objects) const;
|
2016-03-04 15:29:31 +00:00
|
|
|
|
|
|
|
public:
|
2016-03-25 17:40:39 +00:00
|
|
|
Player(float x, float y);
|
2016-03-09 19:01:15 +00:00
|
|
|
|
2016-03-08 17:07:21 +00:00
|
|
|
/**
|
2016-03-08 18:50:21 +00:00
|
|
|
* Dessine la balle dans la fenêtre donnée
|
2016-03-08 17:07:21 +00:00
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
virtual void draw(Manager& manager);
|
2016-03-04 15:29:31 +00:00
|
|
|
|
2016-03-13 18:07:35 +00:00
|
|
|
/**
|
|
|
|
* Récupère la boîte englobante de l'objet
|
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
virtual std::unique_ptr<sf::FloatRect> getAABB() const;
|
2016-03-15 21:00:03 +00:00
|
|
|
|
|
|
|
/**
|
2016-03-25 18:15:51 +00:00
|
|
|
* Récupère l'identifiant de type de cet objet
|
2016-03-15 21:00:03 +00:00
|
|
|
*/
|
2016-03-25 18:15:51 +00:00
|
|
|
static constexpr unsigned int TYPE_ID = 0;
|
2016-03-28 15:23:47 +00:00
|
|
|
virtual unsigned int getTypeId() const;
|
2016-03-19 21:59:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Renvoie le rayon de la balle
|
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
float getRadius() const;
|
2016-03-25 19:13:47 +00:00
|
|
|
|
2016-03-25 17:40:39 +00:00
|
|
|
/**
|
|
|
|
* Renvoie le numéro du joueur
|
|
|
|
*/
|
2016-03-28 15:23:47 +00:00
|
|
|
unsigned int getPlayerNumber() const;
|
2016-03-25 17:40:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Modifie le numéro du joueur
|
|
|
|
*/
|
|
|
|
void setPlayerNumber(unsigned int set_number);
|
2016-03-04 15:29:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|