-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
42 lines (35 loc) · 993 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
35
36
37
38
39
40
41
#ifndef PLAYER_H
#define PLAYER_H
#include "vector2d.h"
#include "block.h"
#include "movable.h"
#include "manager.h"
#include "factory.h"
// Here we mean position of the Movable as a Block.a
class Player : public Movable, public Block
{
public:
Player();
Player(const Vector2D &left, const Vector2D &right, double height,
double max_speed, double max_force, double curr = 0.5);
virtual ~Player() = 0;
virtual void init(const Vector2D &left, const Vector2D &right,
double height, double max_speed, double max_force,
double curr) = 0;
virtual bool move() override;
virtual void idle(void) = 0;
virtual Vector2D get_force() = 0;
protected:
double getMaxForce() const;
double getMaxSpeed() const;
protected:
void initDefault(const Vector2D & left, const Vector2D & right,
double height, double max_speed, double max_force,
double curr);
private:
void set_block(void);
double height_;
double max_force_;
double max_speed_;
};
#endif // PLAYER_H