diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2010-03-22 11:16:21 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2010-03-22 18:49:33 +0100 |
commit | f076dba08f371e3949cac9e25bc3d57cbe09a133 (patch) | |
tree | 5bae121339342f2052f3cfcca04d47b4cb7ecd7a /crawl-ref/source/los_def.h | |
parent | dea589d649ce656f83f31d3333ba61cb7b4194cb (diff) | |
download | crawl-ref-f076dba08f371e3949cac9e25bc3d57cbe09a133.tar.gz crawl-ref-f076dba08f371e3949cac9e25bc3d57cbe09a133.zip |
Update actor::get_los to use global LOS.
This is all not very nice.
los_base is now an abstract base class for both los_def and
los_glob (global LOS-backed los_def variant), and interators
now take a *los_base.
actor::update_los is gone.
Arena LOS is quite probably broken again at the moment.
Diffstat (limited to 'crawl-ref/source/los_def.h')
-rw-r--r-- | crawl-ref/source/los_def.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/crawl-ref/source/los_def.h b/crawl-ref/source/los_def.h index bc2cf4d8ff..4daad4375d 100644 --- a/crawl-ref/source/los_def.h +++ b/crawl-ref/source/los_def.h @@ -3,9 +3,43 @@ #include "coord-circle.h" #include "los.h" +#include "losglobal.h" #include "losparam.h" -class los_def +class los_base +{ +public: + virtual ~los_base() {} + + virtual coord_def get_center() const = 0; + virtual circle_def get_bounds() const = 0; + + virtual bool in_bounds(const coord_def& p) const = 0; + virtual bool see_cell(const coord_def& p) const = 0; +}; + +class los_glob : public los_base +{ + los_type lt; + coord_def center; + circle_def bds; + +public: + los_glob() {} + los_glob(const coord_def& c, los_type l, + const circle_def &b = BDS_DEFAULT) + : lt(l), center(c), bds(b) {} + + los_glob& operator=(const los_glob& other); + + coord_def get_center() const; + circle_def get_bounds() const; + + bool in_bounds(const coord_def& p) const; + bool see_cell(const coord_def& p) const; +}; + +class los_def : public los_base { los_grid show; coord_def center; @@ -24,7 +58,7 @@ public: const circle_def& b); void init_arena(const coord_def& center); void set_center(const coord_def& center); - coord_def get_center(); + coord_def get_center() const; void set_opacity(const opacity_func& o); void set_bounds(const circle_def& b); circle_def get_bounds() const; |