Re: Room size in java code


Code: Select all
public static void addRightAngleRail(Home home,
UserPreferences preferences, Float houseLength, Float houseBreadth) {
HomePieceOfFurniture furniture;
furniture =createFurniture(preferences,7 , 2, houseLength,houseBreadth-100);
furniture.setColor(-255);
furniture.setAngle(1.57f);
home.addPieceOfFurniture(furniture);
}Code: Select all
public class ExecuteCommand {
public static void drawHouse(Home home, UserPreferences preferences, float houseLength, float houseBreadth){
float xRef = 10;
float yRef = 10;
float wallThickness = 10;
float wall_1_X1Start = xRef;
float wall_1_Y1Start = yRef;
float wall_1_X2End = xRef + houseLength;
float wall_1_Y2End = yRef;
float wall_2_X1Start = xRef + houseLength;
float wall_2_Y1Start = yRef;
float wall_2_X2End = xRef + houseLength;
float wall_2_Y2End = yRef + houseBreadth;
float wall_3_X1Start = xRef + houseLength;
float wall_3_Y1Start = yRef + houseBreadth;
float wall_3_X2End = xRef;
float wall_3_Y2End = yRef + houseBreadth;
float wall_4_X1Start = xRef;
float wall_4_Y1Start = yRef + houseBreadth;
float wall_4_X2End = xRef;
float wall_4_Y2End = yRef;
Wall wall_1 = new Wall(wall_1_X1Start, wall_1_Y1Start, wall_1_X2End, wall_1_Y2End,wallThickness);
Wall wall_2 = new Wall(wall_2_X1Start, wall_2_Y1Start, wall_2_X2End, wall_2_Y2End,wallThickness);
Wall wall_3 = new Wall(wall_3_X1Start, wall_3_Y1Start, wall_3_X2End, wall_3_Y2End,wallThickness);
Wall wall_4 = new Wall(wall_4_X1Start, wall_4_Y1Start, wall_4_X2End, wall_4_Y2End,wallThickness);
//TextureImage firstTexture = preferences.getTexturesCatalog().getCategories().get(2).getTexture(6);
TextureImage firstTexture = getdefaultHouseWallTexture(preferences);
wall_1.setLeftSideTexture(new HomeTexture(firstTexture));
wall_2.setLeftSideTexture(new HomeTexture(firstTexture));
wall_3.setLeftSideTexture(new HomeTexture(firstTexture));
wall_4.setLeftSideTexture(new HomeTexture(firstTexture));
home.addWall(wall_1);
home.addWall(wall_2);
home.addWall(wall_3);
home.addWall(wall_4);