squareGroup.cc
Go to the documentation of this file.
/* positionGroup.cc
*/
#include "osl/rating/group/squareGroup.h"
osl::rating::
RelativeKingXGroup::RelativeKingXGroup(bool a) : Group(a ? "KingRelAX" : "KingRelDX"), attack(a)
{
for (int x=0; x<9; ++x) {
for (int old_x=0; old_x<10; ++old_x) {
for (int s=PTYPE_PIECE_MIN; s<=PTYPE_MAX; ++s) {
for (int p=0; p<8; ++p) // progress8
push_back(new RelativeKingX(x, old_x, a, static_cast<Ptype>(s)));
}
}
}
}
osl::rating::
RelativeKingYGroup::RelativeKingYGroup(bool a) : Group(a ? "KingRelAY" : "KingRelDY"), attack(a)
{
for (int y=-8; y<9; ++y) {
for (int old_y=-8; old_y<10; ++old_y) {
for (int s=PTYPE_PIECE_MIN; s<=PTYPE_MAX; ++s) {
for (int p=0; p<8; ++p) // progress8
push_back(new RelativeKingY(y, old_y, a, static_cast<Ptype>(s)));
}
}
}
}
osl::rating::SquareXGroup::SquareXGroup() : Group("SquareX")
{
for (int x=1; x<=5; ++x) {
for (int s=PTYPE_PIECE_MIN; s<=PTYPE_BASIC_MIN; ++s) { // we cannot drop KING
for (int p=0; p<8; ++p) // progress8
push_back(new SquareX(x, static_cast<Ptype>(s), false));
}
for (int s=PTYPE_BASIC_MIN+1; s<=PTYPE_MAX; ++s) {
for (int p=0; p<8; ++p) // progress8
push_back(new SquareX(x, static_cast<Ptype>(s), false));
for (int p=0; p<8; ++p) // progress8
push_back(new SquareX(x, static_cast<Ptype>(s), true));
}
}
}
osl::rating::SquareYGroup::SquareYGroup() : Group("SquareY")
{
for (int y=1; y<=9; ++y) {
for (int s=PTYPE_PIECE_MIN; s<=PTYPE_BASIC_MIN; ++s) { // we cannot drop KING
for (int p=0; p<8; ++p) // progress8
push_back(new SquareY(y, static_cast<Ptype>(s), false));
}
for (int s=PTYPE_BASIC_MIN+1; s<=PTYPE_MAX; ++s) {
for (int p=0; p<8; ++p) // progress8
push_back(new SquareY(y, static_cast<Ptype>(s), false));
for (int p=0; p<8; ++p) // progress8
push_back(new SquareY(y, static_cast<Ptype>(s), true));
}
}
}
/* ------------------------------------------------------------------------- */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::rating::Group::Group
Group(const std::string &name)
Definition group.cc:15
osl::rating::RelativeKingX
Definition square.h:44
osl::rating::RelativeKingY
Definition square.h:81
osl::rating::SquareX
Definition square.h:125
osl::rating::SquareY
Definition square.h:147
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::PTYPE_PIECE_MIN
@ PTYPE_PIECE_MIN
Definition basic_type.h:104
osl::PTYPE_MAX
@ PTYPE_MAX
Definition basic_type.h:105
osl::PTYPE_BASIC_MIN
@ PTYPE_BASIC_MIN
Definition basic_type.h:103
squareGroup.h
osl::rating::RelativeKingXGroup::attack
bool attack
Definition squareGroup.h:15
osl::rating::RelativeKingXGroup::RelativeKingXGroup
RelativeKingXGroup(bool a)
Definition squareGroup.cc:6
osl::rating::RelativeKingYGroup::attack
bool attack
Definition squareGroup.h:33
osl::rating::RelativeKingYGroup::RelativeKingYGroup
RelativeKingYGroup(bool a)
Definition squareGroup.cc:19
osl::rating::SquareXGroup::SquareXGroup
SquareXGroup()
Definition squareGroup.cc:31
osl::rating::SquareYGroup::SquareYGroup
SquareYGroup()
Definition squareGroup.cc:47