Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
checkmate
pawnCheckmateMoves.h
Go to the documentation of this file.
1
/* pawnCheckmateMoves.h
2
*/
3
#ifndef _PAWNCHECKMATEMOVES_H
4
#define _PAWNCHECKMATEMOVES_H
5
6
#include "
osl/move.h
"
7
namespace
osl
8
{
9
namespace
checkmate
10
{
11
struct
PawnCheckmateMoves
12
{
17
template
<Player P>
18
static
bool
effectiveOnlyIfPawnCheckmate
(
Ptype
ptype,
19
Square
from,
Square
to)
20
{
21
return
((ptype ==
PAWN
) || (ptype ==
ROOK
) || (ptype ==
BISHOP
))
22
&& (from.
canPromote
<P>() || to.
canPromote
<P>());
23
}
24
static
bool
effectiveOnlyIfPawnCheckmate
(
Player
a,
Ptype
ptype,
25
Square
from,
Square
to)
26
{
27
return
((ptype ==
PAWN
) || (ptype ==
ROOK
) || (ptype ==
BISHOP
))
28
&& (from.
canPromote
(a) || to.
canPromote
(a));
29
}
30
static
bool
effectiveOnlyIfPawnCheckmate
(
Move
m)
31
{
32
return
effectiveOnlyIfPawnCheckmate
(m.
player
(), m.
ptype
(),
33
m.
from
(), m.
to
());
34
}
35
36
static
bool
hasParingNoPromote
(
bool
isPromote,
Ptype
ptype)
37
{
38
return
isPromote
39
&& ((ptype ==
PPAWN
) || (ptype ==
PROOK
) || (ptype ==
PBISHOP
));
40
}
45
static
bool
hasParingNoPromote
(
Move
m)
46
{
47
return
hasParingNoPromote
(m.
isPromotion
(), m.
ptype
());
48
}
49
};
50
}
// namespace checkmate
51
}
// namespace osl
52
53
#endif
/* _PAWNCHECKMATEMOVES_H */
54
// ;;; Local Variables:
55
// ;;; mode:c++
56
// ;;; c-basic-offset:2
57
// ;;; End:
Generated on Sun Jul 21 2013 13:37:26 by
1.8.4