420 |
namespace |
namespace |
421 |
{ |
{ |
422 |
class MirrorStone |
class MirrorStone |
423 |
: public MovableStone, public LaserEmitter, public PhotoCell |
: public Stone, public LaserEmitter, public PhotoCell |
424 |
{ |
{ |
425 |
protected: |
protected: |
426 |
MirrorStone(const char *name, bool movable=false, bool transparent=false); |
MirrorStone(const char *name, bool movable=false, bool transparent=false); |
427 |
virtual ~MirrorStone() {} |
virtual ~MirrorStone() {} |
428 |
|
|
429 |
bool is_transparent() const { return int_attrib("transparent"); } |
bool is_transparent() const { return int_attrib("transparent"); } |
430 |
bool is_movable() const { return int_attrib("movable"); } |
bool is_movable() { return int_attrib("movable"); } |
431 |
|
|
432 |
void set_orientation(int o) { set_attrib("orientation", o); } |
void set_orientation(int o) { set_attrib("orientation", o); } |
433 |
int get_orientation() { return int_attrib("orientation"); } |
int get_orientation() { return int_attrib("orientation"); } |
468 |
} |
} |
469 |
|
|
470 |
MirrorStone::MirrorStone(const char *name, bool movable, bool transparent) |
MirrorStone::MirrorStone(const char *name, bool movable, bool transparent) |
471 |
: MovableStone(name) |
: Stone(name) |
472 |
, outdirs(NODIRBIT) |
, outdirs(NODIRBIT) |
473 |
{ |
{ |
474 |
set_attrib("transparent", transparent); |
set_attrib("transparent", transparent); |
529 |
void MirrorStone::actor_hit(const StoneContact &sc) |
void MirrorStone::actor_hit(const StoneContact &sc) |
530 |
{ |
{ |
531 |
if (is_movable()) |
if (is_movable()) |
532 |
MovableStone::actor_hit(sc); |
maybe_push_stone(sc); |
533 |
rotate_right(); |
rotate_right(); |
534 |
} |
} |
535 |
|
|
748 |
Register ("st-mirror-3<t", new TriangleMirror('<', false, true)); |
Register ("st-mirror-3<t", new TriangleMirror('<', false, true)); |
749 |
Register ("st-mirror-3^t", new TriangleMirror('^', false, true)); |
Register ("st-mirror-3^t", new TriangleMirror('^', false, true)); |
750 |
Register ("st-mirror-3>t", new TriangleMirror('>', false, true)); |
Register ("st-mirror-3>t", new TriangleMirror('>', false, true)); |
751 |
|
Register ("st-mirror-3vtm", new TriangleMirror('v', true, true)); |
752 |
|
Register ("st-mirror-3<tm", new TriangleMirror('<', true, true)); |
753 |
|
Register ("st-mirror-3^tm", new TriangleMirror('^', true, true)); |
754 |
|
Register ("st-mirror-3>tm", new TriangleMirror('>', true, true)); |
755 |
|
|
756 |
Register (new PlaneMirror); |
Register (new PlaneMirror); |
757 |
Register ("st-mirror-p|", new PlaneMirror('|')); |
Register ("st-mirror-p|", new PlaneMirror('|')); |
766 |
Register ("st-mirror-p/t", new PlaneMirror('/', false, true)); |
Register ("st-mirror-p/t", new PlaneMirror('/', false, true)); |
767 |
Register ("st-mirror-p-t", new PlaneMirror('-', false, true)); |
Register ("st-mirror-p-t", new PlaneMirror('-', false, true)); |
768 |
Register ("st-mirror-p\\t", new PlaneMirror('\\', false, true)); |
Register ("st-mirror-p\\t", new PlaneMirror('\\', false, true)); |
769 |
|
Register ("st-mirror-p|tm", new PlaneMirror('|', true, true)); |
770 |
|
Register ("st-mirror-p/tm", new PlaneMirror('/', true, true)); |
771 |
|
Register ("st-mirror-p-tm", new PlaneMirror('-', true, true)); |
772 |
|
Register ("st-mirror-p\\tm", new PlaneMirror('\\', true, true)); |
773 |
} |
} |
774 |
|
|
775 |
|
|