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
|
#include "osl/direction.h"
#include <iostream>
bool osl::isValid(Direction d){
return DIRECTION_MIN<=d && d<=DIRECTION_MAX;
}
namespace osl
{
std::ostream& operator<<(std::ostream& os,const Direction d){
static const char* names[]={
"UL","U","UR","L",
"R","DL","D","DR",
"UUL","UUR","LONG_UL",
"LONG_U","LONG_UR","LONG_L",
"LONG_R","LONG_DL","LONG_D","LONG_DR"
};
return os << names[static_cast<int>(d)];
}
}
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
|