about summary refs log tree commit diff stats
path: root/VERSION
blob: d6c415b40ab9d85ed1d3e9bc96fc68b082fda5d7 (plain) (blame)
1
v0.6.6
/* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#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;

  void clearSpriteCache() override;

private:
  Game& game_;

  vec2i pos_;
  vec2i fov_ { CANVAS_WIDTH, CANVAS_HEIGHT };
  int followingSprite_ = -1;
  bool locked_ = true;
};

#endif /* end of include guard: CAMERA_SYSTEM_H_D52ADAD3 */