00001 #ifndef LOS_DEF_H 00002 #define LOS_DEF_H 00003 00004 #include "coord-circle.h" 00005 #include "los.h" 00006 #include "losglobal.h" 00007 #include "losparam.h" 00008 00009 class los_base 00010 { 00011 public: 00012 virtual ~los_base() {} 00013 00014 virtual coord_def get_center() const = 0; 00015 virtual circle_def get_bounds() const = 0; 00016 00017 virtual bool in_bounds(const coord_def& p) const = 0; 00018 virtual bool see_cell(const coord_def& p) const = 0; 00019 }; 00020 00021 class los_glob : public los_base 00022 { 00023 los_type lt; 00024 coord_def center; 00025 circle_def bds; 00026 00027 public: 00028 los_glob() {} 00029 los_glob(const coord_def& c, los_type l, 00030 const circle_def &b = BDS_DEFAULT) 00031 : lt(l), center(c), bds(b) {} 00032 00033 los_glob& operator=(const los_glob& other); 00034 00035 coord_def get_center() const; 00036 circle_def get_bounds() const; 00037 00038 bool in_bounds(const coord_def& p) const; 00039 bool see_cell(const coord_def& p) const; 00040 }; 00041 00042 class los_def : public los_base 00043 { 00044 los_grid show; 00045 coord_def center; 00046 opacity_func const * opc; 00047 circle_def bds; 00048 bool arena; 00049 00050 public: 00051 los_def(); 00052 los_def(const coord_def& c, const opacity_func &o = opc_default, 00053 const circle_def &b = BDS_DEFAULT); 00054 los_def(const los_def& l); 00055 ~los_def(); 00056 los_def& operator=(const los_def& l); 00057 void init(const coord_def& center, const opacity_func& o, 00058 const circle_def& b); 00059 void init_arena(const coord_def& center); 00060 void set_center(const coord_def& center); 00061 coord_def get_center() const; 00062 void set_opacity(const opacity_func& o); 00063 void set_bounds(const circle_def& b); 00064 circle_def get_bounds() const; 00065 00066 void update(); 00067 bool in_bounds(const coord_def& p) const; 00068 bool see_cell(const coord_def& p) const; 00069 }; 00070 00071 #endif