blob: 3eb837493ebb8663346557a71dba2304b90c74cb (
plain) (
blame)
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
|
#ifndef CAMERA_SYSTEM_H_D52ADAD3
#define CAMERA_SYSTEM_H_D52ADAD3
#include "consts.h"
#include "system.h"
#include "vector.h"
class Game;
class CameraSystem : public System {
public:
static constexpr SystemKey Key = SystemKey::Camera;
CameraSystem(Game& game) : game_(game) {}
const vec2i& getCameraPosition() const { return pos_; }
const vec2i& getFieldOfView() const { return fov_; }
void setFollowingSprite(int spriteId) { followingSprite_ = spriteId; }
void lockCamera() { locked_ = true; }
void unlockCamera() { locked_ = false; }
void tick(double dt) override;
private:
Game& game_;
vec2i pos_;
vec2i fov_ { CANVAS_WIDTH, CANVAS_HEIGHT };
int followingSprite_;
bool locked_ = true;
};
#endif /* end of include guard: CAMERA_SYSTEM_H_D52ADAD3 */
|