square.cc
Go to the documentation of this file.
00001 /* square.cc
00002  */
00003 #include "osl/rating/feature/square.h"
00004 #include "osl/ptypeTable.h"
00005 #include <sstream>
00006 
00007 const std::string osl::rating::
00008 RelativeKingX::name(int x, int old_x, bool /*attack*/, Ptype ptype)
00009 {
00010   std::ostringstream os;
00011   os << "X";
00012   if (old_x == 9)
00013       os << "d";
00014   else 
00015       os << old_x << "->";
00016   os << x << Ptype_Table.getCsaName(ptype);
00017   return os.str();
00018 }
00019 
00020 const std::string osl::rating::
00021 RelativeKingY::name(int y, int old_y, bool /*attack*/, Ptype ptype)
00022 {
00023   std::ostringstream os;
00024   os << "Y";
00025   if (old_y == 9)
00026       os << "d";
00027   else 
00028       os << old_y << "->";
00029   os << y << Ptype_Table.getCsaName(ptype);
00030   return os.str();
00031 }
00032 
00033 const std::string osl::rating::SquareX::name(int x) 
00034 {
00035   std::ostringstream os;
00036   os << "PX" << x << "-";
00037   return os.str();
00038 }
00039 const std::string osl::rating::SquareY::name(int y) 
00040 {
00041   std::ostringstream os;
00042   os << "PY" << y << "-";
00043   return os.str();
00044 }
00045 
00046 /* ------------------------------------------------------------------------- */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines