* Applies two differences together * * This function adds two differences together and returns the resulting * difference. So adding two DIRDIFF_REVERSE together results in the * DIRDIFF_SAME difference. * * @param d The first difference * @param delta The second difference to add on * @return The resulting difference */
| 86 | * @return The resulting difference |
| 87 | */ |
| 88 | inline DirDiff ChangeDirDiff(DirDiff d, DirDiff delta) |
| 89 | { |
| 90 | /* Cast to uint so compiler can use bitmask. Result can never be negative. */ |
| 91 | return static_cast<DirDiff>((static_cast<uint>(d) + static_cast<uint>(delta)) % 8); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Change a direction by a given difference |
no outgoing calls
no test coverage detected