Roguelike
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
octantprocessor.h
Go to the documentation of this file.
1 #ifndef ROGUELIKE_ALG_LOS_OCTANTPROCESSOR_H_
2 #define ROGUELIKE_ALG_LOS_OCTANTPROCESSOR_H_
3 
4 // Inheritance
5 // (none)
6 
7 // External Dependencies
8 #include <list> //TODO: Use a better data structure for cones_.
9 #include <set>
10 #include <ugdk/portable/tr1.h>
11 #include FROM_TR1(functional)
12 #include <ugdk/math/integer2D.h>
13 #include "utils/integer2Dutils.h"
14 
15 // Internal Dependencies
16 #include "game/alg/los/cone.h"
17 #include "game/alg/los/eye.h"
18 #include "game/alg/los/octant.h"
19 
20 // Forward Declarations
21 #include "game/alg.h"
22 #include "game/alg/los.h"
23 
24 namespace game {
25 namespace alg {
26 namespace los {
27 
29  // lacks operator=
30 
31  public:
32  OctantProcessor(int octant_id, const VisibleTileAction& visible_tile_action, const double& sight_range,
33  const std::set<Eye*>& eyes, const std::tr1::function<bool (const ugdk::math::Integer2D&)>& blocks_vision);
35 
36  void ProcessOctant();
37 
38  void set_origin(const ugdk::math::Integer2D& origin) { octant_.set_origin(origin); }
39 
40  private:
41  bool process_cone_here(Cone* cone);
42  void clean_cones();
43 
44  Octant octant_;
45  std::list<Cone*> cones_;
46 
47  const VisibleTileAction visible_tile_action_;
48  const double& sight_range_;
49  const std::set<Eye*>& eyes_;
50 
51  const std::tr1::function<bool (ugdk::math::Integer2D&)> blocks_vision_;
52  const std::tr1::function<bool (Cone*)> cone_processor_; // process_cone_here's incarnation as a non-method function.
53 };
54 
55 } // namespace los
56 } // namespace alg
57 } // namespace game
58 
59 #endif // ROGUELIKE_ALG_LOS_OCTANTPROCESSOR_H_
void set_origin(const ugdk::math::Integer2D &origin)
Definition: octantprocessor.h:38
Definition: cone.h:21
Definition: aim.cc:15
OctantProcessor(int octant_id, const VisibleTileAction &visible_tile_action, const double &sight_range, const std::set< Eye * > &eyes, const std::tr1::function< bool(const ugdk::math::Integer2D &)> &blocks_vision)
Definition: octantprocessor.cc:29
void ProcessOctant()
Definition: octantprocessor.cc:38
void set_origin(const ugdk::math::Integer2D &origin)
Definition: octant.h:40
bool blocks_vision(const Integer2D &tile)
Definition: vision.cc:27
std::tr1::function< void(const ugdk::math::Integer2D &tile, const EquationalLineDouble &upper, const EquationalLineDouble &lower, enums::bump::BumpType bump)> VisibleTileAction
Definition: los.h:37
Definition: octant.h:21
~OctantProcessor()
Definition: octantprocessor.cc:36
Definition: octantprocessor.h:28