Roguelike
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
octant.h
Go to the documentation of this file.
1 #ifndef ROGUELIKE_ALG_LOS_OCTANT_H_
2 #define ROGUELIKE_ALG_LOS_OCTANT_H_
3 
4 // Inheritance
5 // (none)
6 
7 // External Dependencies
8 #include <ugdk/math/integer2D.h>
9 
10 // Internal Dependencies
12 
13 // Forward Declarations
14 #include "game/alg.h"
15 #include "game/alg/los.h"
16 
17 namespace game {
18 namespace alg {
19 namespace los {
20 
21 class Octant {
22  // lacks operator=
23  Octant& operator=(const Octant&);
24 
25  public:
26  Octant(int id, double range_squared);
27  ~Octant();
28 
29  ugdk::math::Integer2D FocusCoordinates() const;
30  ugdk::math::Integer2D FakeCoordinates() const { return **iterator_; }
31 
32  bool FocusIsOutOfBounds() const;
33  bool FocusIsControlTile() const;
34 
35  OctantIterator* iterator() { return iterator_; }
36 
37  int parity() const { return parity_; }
38  int rotations() const { return rotations_; }
39 
40  void set_origin(const ugdk::math::Integer2D& origin) { origin_ = origin; }
41 
42  private:
43  const int parity_;
44  const int rotations_;
45  ugdk::math::Integer2D origin_;
46  OctantIterator* iterator_;
47 
48 };
49 
50 } // namespace los
51 } // namespace alg
52 } // namespace game
53 
54 #endif // ROGUELIKE_ALG_LOS_OCTANT_H_
OctantIterator * iterator()
Definition: octant.h:35
Definition: octantiterator.h:20
ugdk::math::Integer2D FakeCoordinates() const
Definition: octant.h:30
ugdk::math::Integer2D FocusCoordinates() const
Definition: octant.cc:32
bool FocusIsControlTile() const
Definition: octant.cc:47
bool FocusIsOutOfBounds() const
Definition: octant.cc:41
Definition: aim.cc:15
~Octant()
Definition: octant.cc:30
int rotations() const
Definition: octant.h:38
void set_origin(const ugdk::math::Integer2D &origin)
Definition: octant.h:40
int parity() const
Definition: octant.h:37
Definition: octant.h:21
Octant(int id, double range_squared)
Definition: octant.cc:21