public int getRotation() { int rotation = 0; if (actType == rotatedType) { rotation = 0; } else if (actType.rotateRight() == rotatedType) { rotation = 1; } else if (actType.rotateLeft() == rotatedType) { rotation = -1; } else { rotation = 2; } return rotation; }
private void setRotatedTypeForNextRoom() { if (!triedTypes.containsKey(prev)) { triedTypes.put(prev, new HashSet<RoomType>()); rotatedType = actType; } else if (rotatable) { rotatedType = rotatedType.rotateRight(); } }
public void rotateRightRotatedType() { rotatedType = rotatedType.rotateRight(); }
public void rotateLeftRotatedType() { rotatedType = rotatedType.rotateLeft(); }
public void rotateRightActType() { actType = actType.rotateRight(); }
public void rotateLeftActType() { actType = actType.rotateLeft(); }
public Direction getExit() { return rotatedType.getExitByEntrance(getEntrance()); }
public Direction getEntrance() { return rotatedType.hasEntrance(actEntrance) ? actEntrance : null; }