MCPcopy Create free account
hub / github.com/SimHacker/micropolis / rotate45

Function rotate45

MicropolisCore/src/MicropolisEngine/src/position.h:113–116  ·  view source on GitHub ↗

* Increment the direction by 45 degrees. * @param dir Direction to rotate. * @return Rotated direction. */

Source from the content-addressed store, hash-verified

111 * @return Rotated direction.
112 */
113static inline Direction2 rotate45(Direction2 dir, int count = 1)
114{
115 return (Direction2)(((dir - DIR2_NORTH + count) & 7) + DIR2_NORTH);
116}
117
118/**
119 * Rotate the direction by 90 degrees.

Callers 4

rotate90Function · 0.85
rotate180Function · 0.85
doBRiverMethod · 0.85
doSRiverMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected