engine/generators/fortresses/source/MotteBaileyCastleGeneratorStrategy.cpp
// The motte is the keep, bailey is the courtyard.
The motte is the keep, bailey is the courtyard.
The motte is the keep bailey is the courtyard .
void MotteBaileyCastleGeneratorStrategy::generate(MapPtr castle_map)
{
  Dimensions d;
  int start_y = RNG::range(2, d.get_y() / 4);
  int start_x = RNG::range(5, d.get_x() / 4);
  int end_y = d.get_y() - start_y;
  int end_x = d.get_x() - start_x;
  int motte_width = RNG::range(MIN_MOTTE_WIDTH, end_x - start_x - 4);
  int motte_height = RNG::range(MIN_MOTTE_HEIGHT, end_y - start_y - 4);
  generate_moat(castle_map, start_y, start_x, end_y, end_x);
  generate_motte(castle_map, motte_height, motte_width);
  generate_bridge(castle_map, start_y, start_x, end_y, end_x);
}
void MotteBaileyCastleGeneratorStrategy :: generate ( MapPtr castle_map ) { Dimensions d ; int start_y = RNG :: range ( 2 , d . get_y ( ) / 4 ) ; int start_x = RNG :: range ( 5 , d . get_x ( ) / 4 ) ; int end_y = d . get_y ( ) - start_y ; int end_x = d . get_x ( ) - start_x ; int motte_width = RNG :: range ( MIN_MOTTE_WIDTH , end_x - start_x - 4 ) ; int motte_height = RNG :: range ( MIN_MOTTE_HEIGHT , end_y - start_y - 4 ) ; generate_moat ( castle_map , start_y , start_x , end_y , end_x ) ; generate_motte ( castle_map , motte_height , motte_width ) ; generate_bridge ( castle_map , start_y , start_x , end_y , end_x ) ; }
The motte is the keep, bailey is the courtyard.
The motte is the keep bailey is the courtyard .