- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
{
if(find(p) == board.end() || (*find(p))->suit != (*selected)->suit)[&]
{
{
auto it = std::find_if(board.pieceCapturings().begin(),
board.pieceCapturings().end(),
[&](board::Board::Movements_t::value_type const &m)
{
return m.first == selected && m.second == p;
});
if(it != board.pieceCapturings().end())
{
for(auto jt = board.pieceCapturables().begin(); jt != board.pieceCapturables().end(); ++jt)
{
if(jt->second == p)
{
if(board.capture(selected, it, jt))
{
nextTurn();
return;
}
}
}
}
}
{
auto it = std::find_if(board.pieceTrajectories().begin(),
board.pieceTrajectories().end(),
[&](board::Board::Movements_t::value_type const &m)
{
return m.first == selected && m.second == p;
});
if(it != board.pieceTrajectories().end())
{
if(board.move(selected, it))
{
nextTurn();
}
}
}
}();
selected = board.end(); //deselect
}
Комментарии (0) RSS
Добавить комментарий