My Project
std
osl
rating
feature
square.cc
Go to the documentation of this file.
1
/* square.cc
2
*/
3
#include "
osl/rating/feature/square.h
"
4
#include "
osl/bits/ptypeTable.h
"
5
#include <sstream>
6
7
const
std::string
osl::rating::
8
RelativeKingX::name
(
int
x,
int
old_x,
bool
/*attack*/
,
Ptype
ptype)
9
{
10
std::ostringstream os;
11
os <<
"X"
;
12
if
(old_x == 9)
13
os <<
"d"
;
14
else
15
os << old_x <<
"->"
;
16
os << x <<
Ptype_Table
.
getCsaName
(ptype);
17
return
os.str();
18
}
19
20
const
std::string
osl::rating::
21
RelativeKingY::name
(
int
y,
int
old_y,
bool
/*attack*/
,
Ptype
ptype)
22
{
23
std::ostringstream os;
24
os <<
"Y"
;
25
if
(old_y == 9)
26
os <<
"d"
;
27
else
28
os << old_y <<
"->"
;
29
os << y <<
Ptype_Table
.
getCsaName
(ptype);
30
return
os.str();
31
}
32
33
const
std::string
osl::rating::SquareX::name
(
int
x)
34
{
35
std::ostringstream os;
36
os <<
"PX"
<<
x
<<
"-"
;
37
return
os.str();
38
}
39
const
std::string
osl::rating::SquareY::name
(
int
y)
40
{
41
std::ostringstream os;
42
os <<
"PY"
<< y <<
"-"
;
43
return
os.str();
44
}
45
46
/* ------------------------------------------------------------------------- */
ptypeTable.h
osl::rating::SquareX::x
int x
Definition:
square.h:126
osl::rating::Feature::name
const std::string & name() const
Definition:
rating/feature.h:24
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition:
basic_type.h:84
osl::Ptype_Table
const PtypeTable Ptype_Table
Definition:
tables.cc:97
square.h
osl::PtypeTable::getCsaName
const char * getCsaName(Ptype ptype) const
Definition:
ptypeTable.h:80
Generated by
1.8.20