| 1734 | } |
| 1735 | |
| 1736 | Point Player::GetTargetPosition() const |
| 1737 | { |
| 1738 | // clang-format off |
| 1739 | constexpr int DirectionOffsetX[8] = { 0,-1, 1, 0,-1, 1, 1,-1 }; |
| 1740 | constexpr int DirectionOffsetY[8] = { -1, 0, 0, 1,-1,-1, 1, 1 }; |
| 1741 | // clang-format on |
| 1742 | Point target = position.future; |
| 1743 | for (auto step : walkpath) { |
| 1744 | if (step == WALK_NONE) |
| 1745 | break; |
| 1746 | if (step > 0) { |
| 1747 | target.x += DirectionOffsetX[step - 1]; |
| 1748 | target.y += DirectionOffsetY[step - 1]; |
| 1749 | } |
| 1750 | } |
| 1751 | return target; |
| 1752 | } |
| 1753 | |
| 1754 | bool Player::IsPositionInPath(Point pos) |
| 1755 | { |
no outgoing calls
no test coverage detected