Roguelike
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
aim.h
Go to the documentation of this file.
1 #ifndef ROGUELIKE_ACTION_AIM_H_
2 #define ROGUELIKE_ACTION_AIM_H_
3 
4 // Inheritance
5 // (none)
6 
7 // External Dependencies
8 // (none)
9 
10 // Internal Dependencies
11 #include "game/ui/cursor.h"
12 
13 // Forward Declarations
14 #include <ugdk/math.h>
15 #include "game/base.h"
16 
17 namespace game {
18 namespace action {
19 
20 class Aim {
21  public:
22  Aim();
23  ~Aim() {}
24 
25  ugdk::math::Integer2D AimedAt() { return target_.tile(); }
26  void AimAt(const ugdk::math::Integer2D& aim);
27  bool IsActive() { return target_.IsActive(); }
28  void ToggleAim() { target_.ToggleActive(); }
29  bool HasOrigin() { return origin_ != nullptr; }
30 
31  void set_origin(const ugdk::math::Integer2D* origin) { origin_ = origin; }
32 
33  private:
34  const ugdk::math::Integer2D* origin_;
35  ui::Cursor target_;
36 };
37 
38 } // namespace action
39 } // namespace game
40 
41 #endif // ROGUELIKE_ACTION_AIM_H_
Definition: aim.cc:15
Aim()
Definition: aim.cc:18
bool IsActive()
Definition: cursor.cc:46
Definition: aim.h:20
void AimAt(const ugdk::math::Integer2D &aim)
Definition: aim.cc:20
void ToggleAim()
Definition: aim.h:28
ugdk::math::Integer2D AimedAt()
Definition: aim.h:25
ugdk::math::Integer2D tile() const
Definition: cursor.h:25
void set_origin(const ugdk::math::Integer2D *origin)
Definition: aim.h:31
void ToggleActive()
Definition: cursor.cc:50
bool IsActive()
Definition: aim.h:27
bool HasOrigin()
Definition: aim.h:29
Definition: cursor.h:20
~Aim()
Definition: aim.h:23