square.cc
Go to the documentation of this file.
/* square.cc
*/
#include "osl/rating/feature/square.h"
#include "osl/bits/ptypeTable.h"
#include <sstream>
const std::string osl::rating::
RelativeKingX::name(int x, int old_x, bool /*attack*/, Ptype ptype)
{
std::ostringstream os;
os << "X";
if (old_x == 9)
os << "d";
else
os << old_x << "->";
os << x << Ptype_Table.getCsaName(ptype);
return os.str();
}
const std::string osl::rating::
RelativeKingY::name(int y, int old_y, bool /*attack*/, Ptype ptype)
{
std::ostringstream os;
os << "Y";
if (old_y == 9)
os << "d";
else
os << old_y << "->";
os << y << Ptype_Table.getCsaName(ptype);
return os.str();
}
const std::string osl::rating::SquareX::name(int x)
{
std::ostringstream os;
os << "PX" << x << "-";
return os.str();
}
const std::string osl::rating::SquareY::name(int y)
{
std::ostringstream os;
os << "PY" << y << "-";
return os.str();
}
/* ------------------------------------------------------------------------- */
osl::rating::Feature::name
const std::string & name() const
Definition rating/feature.h:24
osl::rating::RelativeKingX::ptype
Ptype ptype
Definition square.h:46
osl::rating::RelativeKingX::x
int x
Definition square.h:45
osl::rating::RelativeKingX::old_x
int old_x
Definition square.h:45
osl::rating::RelativeKingY::old_y
int old_y
Definition square.h:82
osl::rating::RelativeKingY::ptype
Ptype ptype
Definition square.h:83
osl::rating::RelativeKingY::y
int y
Definition square.h:82
osl::rating::SquareX::x
int x
Definition square.h:126
osl::rating::SquareY::y
int y
Definition square.h:148
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::Ptype_Table
const PtypeTable Ptype_Table
Definition tables.cc:97
ptypeTable.h
square.h