| 179 | |
| 180 | |
| 181 | cPiece::cConnector cPiece::RotateMoveConnector(const cConnector & a_Connector, int a_NumCCWRotations, int a_MoveX, int a_MoveY, int a_MoveZ) const |
| 182 | { |
| 183 | cPiece::cConnector res(a_Connector); |
| 184 | |
| 185 | // Rotate the res connector: |
| 186 | switch (a_NumCCWRotations) |
| 187 | { |
| 188 | case 0: |
| 189 | { |
| 190 | // No rotation needed |
| 191 | break; |
| 192 | } |
| 193 | case 1: |
| 194 | { |
| 195 | // 1 CCW rotation: |
| 196 | res.m_Direction = RotateBlockFaceCCW(res.m_Direction); |
| 197 | break; |
| 198 | } |
| 199 | case 2: |
| 200 | { |
| 201 | // 2 rotations ( = axis flip): |
| 202 | res.m_Direction = MirrorBlockFaceY(res.m_Direction); |
| 203 | break; |
| 204 | } |
| 205 | case 3: |
| 206 | { |
| 207 | // 1 CW rotation: |
| 208 | res.m_Direction = RotateBlockFaceCW(res.m_Direction); |
| 209 | break; |
| 210 | } |
| 211 | } |
| 212 | res.m_Pos = RotatePos(a_Connector.m_Pos, a_NumCCWRotations); |
| 213 | |
| 214 | // Move the res connector: |
| 215 | res.m_Pos.x += a_MoveX; |
| 216 | res.m_Pos.y += a_MoveY; |
| 217 | res.m_Pos.z += a_MoveZ; |
| 218 | |
| 219 | return res; |
| 220 | } |
| 221 | |
| 222 | |
| 223 |
no test coverage detected