323 |
// This stone can only be passed in one direction. |
// This stone can only be passed in one direction. |
324 |
//---------------------------------------- |
//---------------------------------------- |
325 |
|
|
|
/** \page st-oneway Oneway Stone |
|
|
|
|
|
This stone can be passed by the marble in only one direction |
|
|
|
|
|
\subsection onewaya Attributes |
|
|
|
|
|
- \c orientation \n NORTH, EAST, SOUTH, WEST |
|
|
|
|
|
\subsection onewaye Example |
|
|
\verbatim |
|
|
set_stone("st-oneway", 10,10, {orientation=EAST}) |
|
|
\endverbatim |
|
|
or in short form |
|
|
\verbatim |
|
|
oneway( 10, 10, EAST) |
|
|
\endverbatim |
|
|
|
|
|
\image html st-oneway-e.png |
|
|
*/ |
|
326 |
namespace |
namespace |
327 |
{ |
{ |
328 |
class OneWayBase : public Stone { |
class OneWayBase : public Stone { |
356 |
set_orientation(dir); |
set_orientation(dir); |
357 |
init_model(); |
init_model(); |
358 |
} |
} |
359 |
|
else if (msg == "signal" || msg == "flip") { |
360 |
|
Direction dir = get_orientation(); |
361 |
|
set_orientation(reverse(dir)); |
362 |
|
init_model(); |
363 |
|
} |
364 |
} |
} |
365 |
}; |
}; |
366 |
} |
} |