1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#ifndef LOS_DEF_H
#define LOS_DEF_H
#include "coord-circle.h"
#include "los.h"
#include "losglobal.h"
#include "losparam.h"
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;
opacity_func const * opc;
circle_def bds;
bool arena;
public:
los_def();
los_def(const coord_def& c, const opacity_func &o = opc_default,
const circle_def &b = BDS_DEFAULT);
los_def(const los_def& l);
~los_def();
los_def& operator=(const los_def& l);
void init(const coord_def& center, const opacity_func& o,
const circle_def& b);
void init_arena(const coord_def& center);
void set_center(const coord_def& 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;
void update();
bool in_bounds(const coord_def& p) const;
bool see_cell(const coord_def& p) const;
};
#endif
|