Rev 96 | Rev 169 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 96 | Rev 154 | ||
|---|---|---|---|
| Line 48... | Line 48... | ||
| 48 | // for the given color. We have to provide the position in addition to the color |
48 | // for the given color. We have to provide the position in addition to the color |
| 49 | // because the scale factor may also be a function which should be applied to |
49 | // because the scale factor may also be a function which should be applied to |
| 50 | // the position. For instance, in KBP vs K endgames, the scaling function looks |
50 | // the position. For instance, in KBP vs K endgames, the scaling function looks |
| 51 | // for rook pawns and wrong-colored bishops. |
51 | // for rook pawns and wrong-colored bishops. |
| 52 | ScaleFactor scale_factor(const Position& pos, Color c) const { |
52 | ScaleFactor scale_factor(const Position& pos, Color c) const { |
| 53 |
|
53 | ScaleFactor sf = scalingFunction[c] ? (*scalingFunction[c])(pos) |
| 54 |
|
54 | : SCALE_FACTOR_NONE; |
| 55 |
|
55 | return sf != SCALE_FACTOR_NONE ? sf : ScaleFactor(factor[c]); |
| 56 | } |
56 | } |
| 57 | 57 | ||
| 58 | Key key; |
58 | Key key; |
| 59 | int16_t value; |
59 | int16_t value; |
| 60 | uint8_t factor[COLOR_NB]; |
60 | uint8_t factor[COLOR_NB]; |