engine/generators/crypts/source/VaultCryptLayoutStrategy.cpp
// Given the vault location details and the cardinal direction of the vault
// entrance, get the coordinates.
Given the vault location details and the cardinal direction of the vault
entrance, get the coordinates.
Given the vault location details and the cardinal direction of the vault entrance get the coordinates .
Coordinate VaultCryptLayoutStrategy::get_door_location(const Direction d, const int mid_height, const int mid_width, const int vh, const int vw)
{
  int d_y, d_x;
  switch (d)
  {
    case Direction::DIRECTION_NORTH:
      d_y = mid_height - (vh / 2);
      d_x = mid_width;
      break;
    case Direction::DIRECTION_SOUTH:
      d_y = mid_height + (vh / 2);
      d_x = mid_width;
      break;
    case Direction::DIRECTION_EAST:
      d_y = mid_height;
      d_x = mid_width + (vw / 2);
      break;
    case Direction::DIRECTION_WEST:
    default:
      d_y = mid_height;
      d_x = mid_width - (vw / 2);
      break;
  }
  return make_pair(d_y, d_x);
}
Coordinate VaultCryptLayoutStrategy :: get_door_location ( const Direction d , const int mid_height , const int mid_width , const int vh , const int vw ) { int d_y , d_x ; switch ( d ) { case Direction :: DIRECTION_NORTH : d_y = mid_height - ( vh / 2 ) ; d_x = mid_width ; break ; case Direction :: DIRECTION_SOUTH : d_y = mid_height + ( vh / 2 ) ; d_x = mid_width ; break ; case Direction :: DIRECTION_EAST : d_y = mid_height ; d_x = mid_width + ( vw / 2 ) ; break ; case Direction :: DIRECTION_WEST : default : d_y = mid_height ; d_x = mid_width - ( vw / 2 ) ; break ; } return make_pair ( d_y , d_x ) ; }
Given the vault location details and the cardinal direction of the vault
entrance, get the coordinates.
Given the vault location details and the cardinal direction of the vault entrance get the coordinates .