400 |
: public MovableStone, public LaserEmitter, public PhotoCell |
: public MovableStone, public LaserEmitter, public PhotoCell |
401 |
{ |
{ |
402 |
protected: |
protected: |
403 |
MirrorStone(const char *name); |
MirrorStone(const char *name, bool movable=false, bool transparent=false); |
404 |
|
|
405 |
bool is_transparent() const { return int_attrib("transparent"); } |
bool is_transparent() const { return int_attrib("transparent"); } |
406 |
bool is_movable() const { return int_attrib("movable"); } |
bool is_movable() const { return int_attrib("movable"); } |
443 |
}; |
}; |
444 |
} |
} |
445 |
|
|
446 |
MirrorStone::MirrorStone(const char *name) |
MirrorStone::MirrorStone(const char *name, bool movable, bool transparent) |
447 |
: MovableStone(name) |
: MovableStone(name) |
448 |
{ |
{ |
449 |
set_attrib("transparent", Value()); |
set_attrib("transparent", transparent); |
450 |
set_attrib("movable", Value()); |
set_attrib("movable", movable); |
451 |
set_attrib("orientation", Value(1)); |
set_attrib("orientation", Value(1)); |
452 |
} |
} |
453 |
|
|
514 |
class PlaneMirror : public MirrorStone { |
class PlaneMirror : public MirrorStone { |
515 |
CLONEOBJ(PlaneMirror); |
CLONEOBJ(PlaneMirror); |
516 |
public: |
public: |
517 |
PlaneMirror() : MirrorStone("st-pmirror") { |
PlaneMirror(char orientation='/', bool movable=false, bool transparent=false) |
518 |
set_orientation('/'); |
: MirrorStone("st-pmirror", movable, transparent) |
519 |
|
{ |
520 |
|
set_orientation(orientation); |
521 |
} |
} |
522 |
private: |
private: |
523 |
void set_orientation(char o) { |
void set_orientation(char o) { |
592 |
class TriangleMirror : public MirrorStone { |
class TriangleMirror : public MirrorStone { |
593 |
CLONEOBJ(TriangleMirror); |
CLONEOBJ(TriangleMirror); |
594 |
public: |
public: |
595 |
TriangleMirror() : MirrorStone("st-3mirror") {} |
TriangleMirror(Direction dir=NORTH) |
596 |
|
: MirrorStone("st-3mirror") |
597 |
|
{ |
598 |
|
set_orientation(dir+1); |
599 |
|
} |
600 |
private: |
private: |
601 |
|
|
602 |
Direction get_orientation() |
Direction get_orientation() |
652 |
Register ("st-laser-w", new LaserStone(WEST)); |
Register ("st-laser-w", new LaserStone(WEST)); |
653 |
|
|
654 |
Register (new TriangleMirror); |
Register (new TriangleMirror); |
655 |
|
Register ("st-mirror-3n", new TriangleMirror(NORTH)); |
656 |
|
Register ("st-mirror-3e", new TriangleMirror(EAST)); |
657 |
|
Register ("st-mirror-3s", new TriangleMirror(SOUTH)); |
658 |
|
Register ("st-mirror-3w", new TriangleMirror(WEST)); |
659 |
|
|
660 |
Register (new PlaneMirror); |
Register (new PlaneMirror); |
661 |
|
Register ("st-mirror-p|", new PlaneMirror('|')); |
662 |
|
Register ("st-mirror-p/", new PlaneMirror('/')); |
663 |
|
Register ("st-mirror-p-", new PlaneMirror('-')); |
664 |
|
Register ("st-mirror-p\\", new PlaneMirror('\\')); |
665 |
|
Register ("st-mirror-p|m", new PlaneMirror('|', true)); |
666 |
|
Register ("st-mirror-p/m", new PlaneMirror('/', true)); |
667 |
|
Register ("st-mirror-p-m", new PlaneMirror('-', true)); |
668 |
|
Register ("st-mirror-p\\m", new PlaneMirror('\\', true)); |
669 |
|
Register ("st-mirror-p|t", new PlaneMirror('|', false, true)); |
670 |
|
Register ("st-mirror-p/t", new PlaneMirror('/', false, true)); |
671 |
|
Register ("st-mirror-p-t", new PlaneMirror('-', false, true)); |
672 |
|
Register ("st-mirror-p\\t", new PlaneMirror('\\', false, true)); |
673 |
} |
} |
674 |
|
|
675 |
|
|