Simulator/src/model/map/ModelComponentBuilder.java
/**
	 * Create a sitting area.
	 * 
	 * @param start
	 *            The starting position.
	 * @param numberOfRows
	 *            The number of rows of chairs.
	 * @param numberOfChairsPerRow
	 *            The number of chairs per row.
	 * @param degreeRotation
	 *            The degrees it is rotated (in deg.).
	 * @return A list of SimulationObjects that form the sitting area.
	 */
Create a sitting area.

@param start
The starting position.
@param numberOfRows
The number of rows of chairs.
@param numberOfChairsPerRow
The number of chairs per row.
@param degreeRotation
The degrees it is rotated (in deg.).
@return A list of SimulationObjects that form the sitting area.
Create a sitting area . @param start The starting position . @param numberOfRows The number of rows of chairs . @param numberOfChairsPerRow The number of chairs per row . @param degreeRotation The degrees it is rotated ( in deg . ) . @return A list of SimulationObjects that form the sitting area .
public static List<SimulationObject> sittingArea(Position start, int numberOfRows, int numberOfChairsPerRow,
			double degreeRotation) {
		List<SimulationObject> components = new ArrayList<>();
		double chairWidth = 0.6;
		double chairSpacing = 0.1;
		for (int i = 0; i < numberOfChairsPerRow; i++) {
			for (int j = 0; j < numberOfRows; j++) {
				Position chairPos = new Position(start.x + i * (chairWidth + chairSpacing),
						start.y + j * 3 * chairWidth);
				Position chairEntry = new Position(start.x + 0.5 * chairWidth + i * (chairWidth + chairSpacing),
						start.y - 0.5 + j * 3 * chairWidth);
				Position transformedEntry = Utilities.transform(chairEntry, start, degreeRotation);
				Position transformedPos = Utilities.transform(chairPos, start, degreeRotation);
				Chair c = new Chair(transformedPos, transformedEntry, chairWidth);
				components.add(c);
			}
		}
		Collections.shuffle(components, Utilities.RANDOM_GENERATOR);
		return components;
	}
public static List < SimulationObject > sittingArea ( Position start , int numberOfRows , int numberOfChairsPerRow , double degreeRotation ) { List < SimulationObject > components = new ArrayList < > ( ) ; double chairWidth = 0.6 ; double chairSpacing = 0.1 ; for ( int i = 0 ; i < numberOfChairsPerRow ; i ++ ) { for ( int j = 0 ; j < numberOfRows ; j ++ ) { Position chairPos = new Position ( start . x + i * ( chairWidth + chairSpacing ) , start . y + j * 3 * chairWidth ) ; Position chairEntry = new Position ( start . x + 0.5 * chairWidth + i * ( chairWidth + chairSpacing ) , start . y - 0.5 + j * 3 * chairWidth ) ; Position transformedEntry = Utilities . transform ( chairEntry , start , degreeRotation ) ; Position transformedPos = Utilities . transform ( chairPos , start , degreeRotation ) ; Chair c = new Chair ( transformedPos , transformedEntry , chairWidth ) ; components . add ( c ) ; } } Collections . shuffle ( components , Utilities . RANDOM_GENERATOR ) ; return components ; }
Create a sitting area.
Create a sitting area .