Examples of Wall


Examples of com.eteks.sweethome3d.model.Wall

  /**
   * Restores wall properties from the values stored in <code>modifiedWalls</code>.
   */
  private static void undoModifyWalls(ModifiedWall [] modifiedWalls) {
    for (ModifiedWall modifiedWall : modifiedWalls) {
      Wall wall = modifiedWall.getWall();
      moveWallPoints(wall, modifiedWall.getXStart(), modifiedWall.getYStart(),
          modifiedWall.getXEnd(), modifiedWall.getYEnd());
      wall.setLeftSideColor(modifiedWall.getLeftSideColor());
      wall.setLeftSideTexture(modifiedWall.getLeftSideTexture());
      wall.setLeftSideShininess(modifiedWall.getLeftSideShininess());
      wall.setRightSideColor(modifiedWall.getRightSideColor());
      wall.setRightSideTexture(modifiedWall.getRightSideTexture());
      wall.setRightSideShininess(modifiedWall.getRightSideShininess());
      wall.setHeight(modifiedWall.getHeight());
      wall.setHeightAtEnd(modifiedWall.getHeightAtEnd());
      wall.setThickness(modifiedWall.getThickness());
      wall.setArcExtent(modifiedWall.getArcExtent());
    }
  }
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

      wall.setArcExtent(modifiedWall.getArcExtent());
    }
  }
 
  private static void moveWallPoints(Wall wall, Float xStart, Float yStart, Float xEnd, Float yEnd) {
    Wall wallAtStart = wall.getWallAtStart();
    if (xStart != null) {
      wall.setXStart(xStart);
      // If wall is joined to a wall at its start
      if (wallAtStart != null) {
        // Move the wall start point or end point
        if (wallAtStart.getWallAtStart() == wall) {
          wallAtStart.setXStart(xStart);
        } else if (wallAtStart.getWallAtEnd() == wall) {
          wallAtStart.setXEnd(xStart);
        }
      }
    }
    if (yStart != null) {
      wall.setYStart(yStart);
      // If wall is joined to a wall at its start
      if (wallAtStart != null) {
        // Move the wall start point or end point
        if (wallAtStart.getWallAtStart() == wall) {
          wallAtStart.setYStart(yStart);
        } else if (wallAtStart.getWallAtEnd() == wall) {
          wallAtStart.setYEnd(yStart);
        }
      }
    }
    Wall wallAtEnd = wall.getWallAtEnd();
    if (xEnd != null) {
      wall.setXEnd(xEnd);
      // If wall is joined to a wall at its end 
      if (wallAtEnd != null) {
        // Move the wall start point or end point
        if (wallAtEnd.getWallAtStart() == wall) {
          wallAtEnd.setXStart(xEnd);
        } else if (wallAtEnd.getWallAtEnd() == wall) {
          wallAtEnd.setXEnd(xEnd);
        }
      }
    }
    if (yEnd != null) {
      wall.setYEnd(yEnd);
      // If wall is joined to a wall at its end 
      if (wallAtEnd != null) {
        // Move the wall start point or end point
        if (wallAtEnd.getWallAtStart() == wall) {
          wallAtEnd.setYStart(yEnd);
        } else if (wallAtEnd.getWallAtEnd() == wall) {
          wallAtEnd.setYEnd(yEnd);
        }
      }
    }
  }
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

        new ArrayList<Selectable>(frame.home.getSelectedItems());
    assertEquals("Wrong selected items count", 2, selectedItems.size());
    assertTrue("Piece of furniture not selected", selectedItems.contains(piece));
    // Remove piece form list to get the selected wall
    selectedItems.remove(piece);
    Wall fifthWall = (Wall)selectedItems.get(0);
    // Check piece and wall coordinates
    assertLocationAndOrientationEqualPiece(
        pieceX, pieceY, (float)Math.PI * 3 / 2, piece);
    assertCoordinatesEqualWallPoints(20, 300, 20, 20, fifthWall);
   
    // 8. Drag and drop mouse to (40, 160)
    Thread.sleep(1000); // Wait 1s to avoid double click
    tester.actionMousePress(planComponent,
        new ComponentLocation(new Point(30, 160)));
    tester.actionMouseMove(planComponent, 
        new ComponentLocation(new Point(40, 160)));
    tester.actionMouseRelease();
    // Check the piece of furniture moved 20 cm along x axis
    assertLocationAndOrientationEqualPiece(
        pieceX + 20, pieceY, (float)Math.PI * 3 / 2, piece);
    assertCoordinatesEqualWallPoints(40, 300, 40, 20, fifthWall);
   
    // 9. Click twice on undo button
    tester.invokeAndWait(new Runnable() {
         public void run() {
          frame.undoButton.doClick();
          frame.undoButton.doClick();
         }
       });
    // Check piece orientation and location are canceled
    assertLocationAndOrientationEqualPiece(
        pieceX, pieceY, 0f, piece);
    assertCoordinatesEqualWallPoints(20, 300, 20, 20, fifthWall);
   
    // 10. Click twice on redo button
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.redoButton.doClick();
          frame.redoButton.doClick();
        }
      });
    // Check piece and wall location was redone
    assertLocationAndOrientationEqualPiece(
        pieceX + 20, pieceY, (float)Math.PI * 3 / 2, piece);
    assertCoordinatesEqualWallPoints(40, 300, 40, 20, fifthWall);
    // Check selected items contains the piece of furniture and the fifth wall
    selectedItems = frame.home.getSelectedItems();
    assertEquals("Wrong selected items count",
        2, selectedItems.size());
    assertTrue("Piece of furniture not selected",
        selectedItems.contains(piece));
    assertTrue("Fifth wall not selected",
        selectedItems.contains(fifthWall));
   
    // 11. Click at point (pieceXPixel + depthPixel / 2, pieceYPixel - widthPixel / 2)
    //     at width and depth resize point of the piece
    int pieceXPixel = Math.round((piece.getX() + 40) * planComponent.getScale());
    int pieceYPixel = Math.round((piece.getY() + 40) * planComponent.getScale());
    tester.actionClick(planComponent, pieceXPixel + depthPixel / 2, pieceYPixel - widthPixel / 2);
   
    // Check selected items contains only the piece of furniture
    selectedItems = frame.home.getSelectedItems();
    assertEquals("Wrong selected items count", 1, selectedItems.size());
    assertTrue("Piece of furniture not selected", selectedItems.contains(piece));
    // Drag mouse (4,4) pixels out of piece box with magnetism disabled
    Thread.sleep(1000); // Wait 1s to avoid double click
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2, pieceYPixel - widthPixel / 2)));
    tester.actionKeyPress(KeyEvent.VK_SHIFT);
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2 + 4, pieceYPixel - widthPixel / 2 + 4)));
    tester.actionMouseRelease();
    tester.actionKeyRelease(KeyEvent.VK_SHIFT);
    // Check piece width and depth were resized (caution : piece angle is oriented at 90�)
    assertDimensionEqualPiece(pieceWidth - 4 / planComponent.getScale(),
        pieceDepth + 4 / planComponent.getScale(), pieceHeight, piece);

    // 12. Click at point (pieceXPixel + depthPixel / 2, pieceYPixel + widthPixel / 2)
    //     at height resize point of the piece
    pieceXPixel = Math.round((piece.getX() + 40) * planComponent.getScale());
    pieceYPixel = Math.round((piece.getY() + 40) * planComponent.getScale());
    widthPixel = Math.round((piece.getWidth()) * planComponent.getScale());
    depthPixel = Math.round((piece.getDepth()) * planComponent.getScale());
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2, pieceYPixel + widthPixel / 2)));
    Thread.sleep(1000);
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2, pieceYPixel + widthPixel / 2)));
    // Drag mouse (2,4) pixels
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2 + 2, pieceYPixel + widthPixel / 2 + 4)));
    tester.actionMouseRelease();
    // Check piece height was resized
    assertDimensionEqualPiece(pieceWidth - 4 / planComponent.getScale(),
        pieceDepth + 4 / planComponent.getScale(),
        Math.round((pieceHeight - 4 / planComponent.getScale()) * 2) / 2, piece);

    // 13. Click at point (pieceXPixel - depthPixel / 2, pieceYPixel - widthPixel / 2)
    //     at elevation point of the piece
    float pieceElevation = piece.getElevation();
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(
        pieceXPixel - depthPixel / 2, pieceYPixel - widthPixel / 2)));
    // Drag mouse (2,-4) pixels
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel - depthPixel / 2 + 2, pieceYPixel - widthPixel / 2 - 4)));
    tester.actionMouseRelease();
    // Check piece elevation was updated
    assertElevationEqualPiece(pieceElevation + 4 / planComponent.getScale(), piece);

    // 14. Click three times on undo button
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.undoButton.doClick();
          frame.undoButton.doClick();
          frame.undoButton.doClick();
        }
      });
    // Check piece dimension and elevation are canceled
    assertDimensionEqualPiece(pieceWidth, pieceDepth, pieceHeight, piece);
    assertElevationEqualPiece(pieceElevation, piece);
   
    // Build an ordered list of dimensions added to home
    final ArrayList<DimensionLine> orderedDimensionLines = new ArrayList<DimensionLine>();
    frame.home.addDimensionLinesListener(new CollectionListener<DimensionLine>() {
      public void collectionChanged(CollectionEvent<DimensionLine> ev) {
        if (ev.getType() == CollectionEvent.Type.ADD) {
          orderedDimensionLines.add(ev.getItem());
        }
      }
    });
   
    // 15. Use CREATE_DIMENSION_LINES mode
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.createDimensionsButton.doClick();
        }
      });
    // Draw a dimension in plan
    tester.actionClick(planComponent, 280, 81);
    tester.actionClick(planComponent, 281, 169, InputEvent.BUTTON1_MASK, 2);
    // Draw a dimension with extension lines
    tester.actionClick(planComponent, 41, 175);
    tester.actionClick(planComponent, 269, 175);
    tester.actionClick(planComponent, 280, 185);
    // Check 2 dimensions were added to home plan
    assertEquals("Wrong dimensions count", 2, frame.home.getDimensionLines().size());
    // Check one dimension is selected
    assertEquals("Wrong selection", 1, frame.home.getSelectedItems().size());
    assertEquals("Selection doesn't contain the second dimension",
        frame.home.getSelectedItems().get(0), orderedDimensionLines.get(1));
    // Check the size of the created dimension lines
    DimensionLine firstDimensionLine = orderedDimensionLines.get(0);
    assertEqualsDimensionLine(520, 122, 520, 298, 0, firstDimensionLine);
    assertEqualsDimensionLine(42, 310, 498, 310, 20, orderedDimensionLines.get(1));
   
    // 16. Select the first dimension line
    tester.click(frame.selectButton);
    tester.actionClick(planComponent, 280, 90);
    assertEquals("Wrong selection", 1, frame.home.getSelectedItems().size());
    assertEquals("Selection doesn't contain the first dimension",
        frame.home.getSelectedItems().get(0), firstDimensionLine);
    // Move its end point to (330, 167)
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(280, 167)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(320, 167)));
    // Check its coordinates while Shift key isn't pressed (with magnetism)
    assertEqualsDimensionLine(520, 122, 567.105f, 297.7985f, 0, firstDimensionLine);
    // Check its length with magnetism
    float firstDimensionLineLength = (float)Point2D.distance(
        firstDimensionLine.getXStart(), firstDimensionLine.getYStart(),
        firstDimensionLine.getXEnd(), firstDimensionLine.getYEnd());
    assertTrue("Incorrect length 182 " + firstDimensionLineLength,
        Math.abs(182 - firstDimensionLineLength) < 1E-4);
    // Press Shift key
    tester.actionKeyPress(KeyEvent.VK_SHIFT);
    // Check its coordinates while Shift key is pressed (with no magnetism)
    assertEqualsDimensionLine(520, 122, 600, 298, 0, firstDimensionLine);
    // Release Shift key and mouse button
    tester.actionKeyRelease(KeyEvent.VK_SHIFT);   
    tester.actionMouseRelease();
    assertEqualsDimensionLine(520, 122, 567.105f, 297.7985f, 0, firstDimensionLine);
   
    // 17. Click three times on undo button
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.undoButton.doClick();
          frame.undoButton.doClick();
          frame.undoButton.doClick();
        }
      });
    // Check home doesn't contain any dimension
    assertEquals("Home dimensions set isn't empty", 0, frame.home.getDimensionLines().size());
   
    // 18. Click twice on redo button
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.redoButton.doClick();
          frame.redoButton.doClick();
        }
      });
    // Check the size of the created dimension lines
    assertEqualsDimensionLine(520, 122, 520, 298f, 0, firstDimensionLine);
    assertEqualsDimensionLine(42, 310, 498, 310, 20, orderedDimensionLines.get(1));
    // Click again on redo button
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.redoButton.doClick();
        }
      });
    // Check the first dimension is selected
    assertEquals("Wrong selection", 1, frame.home.getSelectedItems().size());
    assertEquals("Selection doesn't contain the first dimension",
        frame.home.getSelectedItems().get(0), firstDimensionLine);
    // Check the coordinates of the first dimension
    assertEqualsDimensionLine(520, 122, 567.105f, 297.7985f, 0, firstDimensionLine);
   
    // 19. Select two walls, the piece and a dimension line
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(20, 100)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(200, 200)));
    tester.actionMouseRelease();
    // Check selection
    selectedItems = frame.home.getSelectedItems();
    assertEquals("Selection doesn't contain 4 items", 4, selectedItems.size());   
    int wallsCount = frame.home.getWalls().size();
    int furnitureCount = frame.home.getFurniture().size();
    int dimensionLinesCount = frame.home.getDimensionLines().size();
    HomePieceOfFurniture selectedPiece = Home.getFurnitureSubList(selectedItems).get(0);
    pieceX = selectedPiece.getX();
    pieceY = selectedPiece.getY();
    // Start items duplication
    tester.actionKeyPress(OperatingSystem.isMacOSX() ? KeyEvent.VK_ALT : KeyEvent.VK_CONTROL);
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(50, 170)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(51, 170)));
    // Check selection changed
    assertFalse("Selection didn't change", selectedItems.equals(frame.home.getSelectedItems()));
    assertEquals("Selection doesn't contain 4 items", 4, frame.home.getSelectedItems().size());   
    assertEquals("No new wall", wallsCount + 2, frame.home.getWalls().size());   
    assertEquals("No new piece", furnitureCount + 1, frame.home.getFurniture().size());   
    assertEquals("No new dimension lines", dimensionLinesCount + 1, frame.home.getDimensionLines().size());
   
    // 20. Duplicate and move items
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(70, 200)));
    // Check the piece moved and the original piece didn't move
    HomePieceOfFurniture movedPiece =
        Home.getFurnitureSubList(frame.home.getSelectedItems()).get(0);
    assertLocationAndOrientationEqualPiece(pieceX + 20 / planComponent.getScale(),
        pieceY + 30 / planComponent.getScale(), selectedPiece.getAngle(), movedPiece);
    assertLocationAndOrientationEqualPiece(pieceX, pieceY, selectedPiece.getAngle(), selectedPiece);
   
    // 21. Release Alt key
    tester.actionKeyRelease(OperatingSystem.isMacOSX() ? KeyEvent.VK_ALT : KeyEvent.VK_CONTROL);
    // Check original items replaced duplicated items
    assertTrue("Original items not selected", selectedItems.equals(frame.home.getSelectedItems()));
    assertLocationAndOrientationEqualPiece(pieceX + 20 / planComponent.getScale(),
        pieceY + 30 / planComponent.getScale(), selectedPiece.getAngle(), selectedPiece);
    assertFalse("Duplicated piece still in home", frame.home.getFurniture().contains(movedPiece));
    // Press Alt key again
    tester.actionKeyPress(OperatingSystem.isMacOSX() ? KeyEvent.VK_ALT : KeyEvent.VK_CONTROL);
    // Check the duplicated piece moved and the original piece moved back to its original location
    movedPiece = Home.getFurnitureSubList(frame.home.getSelectedItems()).get(0);
    assertLocationAndOrientationEqualPiece(pieceX + 20 / planComponent.getScale(),
        pieceY + 30 / planComponent.getScale(), selectedPiece.getAngle(), movedPiece);
    assertLocationAndOrientationEqualPiece(pieceX, pieceY, selectedPiece.getAngle(), selectedPiece);
    // Press Escape key
    tester.actionKeyStroke(KeyEvent.VK_ESCAPE);
    // Check no items where duplicated
    assertTrue("Original items not selected", selectedItems.equals(frame.home.getSelectedItems()));
    assertLocationAndOrientationEqualPiece(pieceX, pieceY, selectedPiece.getAngle(), selectedPiece);
    assertEquals("New walls created", wallsCount, frame.home.getWalls().size());   
    assertEquals("New pieces created", furnitureCount, frame.home.getFurniture().size());   
    assertEquals("New dimension lines created", dimensionLinesCount, frame.home.getDimensionLines().size());
    tester.actionMouseRelease();
   
    // 22. Duplicate items
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(50, 170)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(50, 190)));
    tester.actionMouseRelease();
    tester.actionKeyRelease(OperatingSystem.isMacOSX() ? KeyEvent.VK_ALT : KeyEvent.VK_CONTROL);
    // Check the duplicated piece moved and the original piece didn't move
    List<Selectable> movedItems = frame.home.getSelectedItems();
    assertEquals("Selection doesn't contain 4 items", 4, movedItems.size());   
    movedPiece = Home.getFurnitureSubList(movedItems).get(0);
    assertLocationAndOrientationEqualPiece(pieceX,
        pieceY + 20 / planComponent.getScale(), selectedPiece.getAngle(), movedPiece);
    assertLocationAndOrientationEqualPiece(pieceX, pieceY, selectedPiece.getAngle(), selectedPiece);
    // Check the duplicated walls are joined to each other
    List<Wall> movedWalls = Home.getWallsSubList(movedItems);
    Wall movedWall1 = movedWalls.get(0);
    Wall movedWall2 = movedWalls.get(1);
    assertFalse("First moved wall not new", selectedItems.contains(movedWall1));
    assertFalse("Second moved wall not new", selectedItems.contains(movedWall2));
    assertSame("First moved wall not joined to second one", movedWall2, movedWall1.getWallAtEnd());
    assertSame("Second moved wall not joined to first one", movedWall1, movedWall2.getWallAtStart());
   
    // 23. Undo duplication
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.undoButton.doClick();
View Full Code Here

Examples of com.eteks.sweethome3d.model.Wall

    planController.pressMouse(20, 302, 1, false, false);
    planController.releaseMouse(20, 302);
    planController.pressMouse(20, 302, 2, false, false);
    planController.releaseMouse(20, 302);
    // Check 3 walls were created at (20, 20), (500, 20), (500, 300) and (20, 300) coordinates
    Wall wall1 = orderedWalls.get(0);
    assertCoordinatesEqualWallPoints(20, 20, 500, 20, wall1);
    Wall wall2 = orderedWalls.get(1);
    assertCoordinatesEqualWallPoints(500, 20, 500, 300, wall2);
    Wall wall3 = orderedWalls.get(2);
    assertCoordinatesEqualWallPoints(500, 300, 20, 300, wall3);
    // Check they are joined to each other end point
    assertWallsAreJoined(null, wall1, wall2);
    assertWallsAreJoined(wall1, wall2, wall3);
    assertWallsAreJoined(wall2, wall3, null);
    // Check they are selected
    assertSelectionContains(home, wall1, wall2, wall3);

    // 3. Click at (20, 300), then double click at (60, 60) with Alt key depressed
    planController.moveMouse(20, 300);
    planController.pressMouse(20, 300, 1, false, false);
    planController.releaseMouse(20, 300);
    planController.toggleMagnetism(true);
    planController.moveMouse(60, 60);
    planController.pressMouse(60, 60, 1, false, false);
    planController.releaseMouse(60, 60);
    planController.pressMouse(60, 60, 2, false, false);
    planController.releaseMouse(60, 60);
    planController.toggleMagnetism(false);
    // Check a forth wall was created at (20, 300), (60, 60) coordinates
    Wall wall4 = orderedWalls.get(orderedWalls.size() - 1);
    assertCoordinatesEqualWallPoints(20, 300, 60, 60, wall4);
    assertSelectionContains(home, wall4);
    assertWallsAreJoined(wall3, wall4, null);

    // 4. Use SELECTION mode
View Full Code Here

Examples of com.tankz.systems.rendering.spatials.Wall

    } else if (spatialFormFile.equalsIgnoreCase("bullet")) {
      return new Bullet(world, e);
    } else if (spatialFormFile.equalsIgnoreCase("explosion")) {
      return new Explosion(world, e);
    } else if (spatialFormFile.equalsIgnoreCase("wall")) {
      return new Wall(world, e);
    }
    return null;
  }
View Full Code Here

Examples of de.christopherstock.shooter.g3d.wall.Wall

                        WallTex.EGlass1, WallHealth.ESolidGlass, WallAction.EDoorSlideRight,
                        DoorStyle.ENoDoor, 0,
                        WALL_OFFICE, CARPET_OFFICE, WallTex.ECeiling1,
                        new Wall[]
                        {
                            new Wall(   Others.EChairOffice1,   new LibVertex1.0f,   1.0f,   0.0f    ), 255.0f,  Scalation.ENone,        Invert.ENo,  WallCollidable.EYes, WallAction.ENone,   WallClimbable.ENo, DrawMethod.EAlwaysDraw, WallTex.ELeather1,     new LibTexture[] { WallTex.EChrome2, },   0, WallHealth.ESolidWood, FXSize.ESmall, null  ),
                            new Sprite( Others.ESprite1,        new LibVertex1.25f6.5f,   0.0f    ),          Scalation.EAddHalf,     WallCollidable.EYes, WallTex.EPlant2 ),
                            new Wall(   Others.EWhiteboard1,    new LibVertex2.5f,   12.0f0.7f    ), 90.0f,   Scalation.EDouble,      Invert.ENo,  WallCollidable.EYes, WallAction.ENone,   WallClimbable.ENo, DrawMethod.EAlwaysDraw, WallTex.EWhiteboard1,  null, 0,               WallHealth.ESolidWood, FXSize.ESmall, null  ),
                            new Wall(   Others.EPoster1,        new LibVertex4.0f,   12.0f0.7f    ), 90.0f,   Scalation.EAddHalf,     Invert.ENo,  WallCollidable.EYes, WallAction.ENone,   WallClimbable.ENo, DrawMethod.EAlwaysDraw, WallTex.EPoster1,      null, 0,               WallHealth.ESolidWood, FXSize.ESmall, null  ),
                            new Wall(   Others.ESofa1,          new LibVertex7.0f,   2.0f,   0.0f    ), 0.0f,    Scalation.ENone,        Invert.ENo,  WallCollidable.EYes, WallAction.ENone,   WallClimbable.ENo, DrawMethod.EAlwaysDraw, WallTex.ELeather2,     new LibTexture[] { WallTex.ETest, }, 0, WallHealth.EFurniture, FXSize.ELarge, null  ),
                        },
                        null,
                        null,
                        null,
                        new int[] { 5, }
                    ),

                    //desk office
                    ShooterWallCollection.createDeskOffice( 2.0f, 3.5f, 2.5f, 270.0f ),


                    //desk lab
                    ShooterWallCollection.createDeskLab( 5.0f, 7.5f, 2.5f, 270.0f ),
                },

                //1st floor - storage
                new WallCollection[]
                {
                    //storage
                    ShooterWallCollection.createRoom
                    (
                        4.0f, 14.0f, 2.5f, 0.0f, 8, 8,
                        WallStyle.ESolidWall, WallStyle.EWindowsAndCeilingWindows, WallStyle.ESolidWall, WallStyle.EWindowsAndCeilingWindows,
                        WallTex.EGlass1, WallHealth.ESolidGlass, WallAction.EDoorSlideRight,
                        DoorStyle.ENoDoor, 0,
                        WALL_OFFICE, CARPET_OFFICE, WallTex.ECeiling1,
                        new Wall[]
                        {
                        },
                        null,
                        null,
                        new int[] { 1, },
                        new int[] { 1, }
                    ),

                    //shelves
                    ShooterWallCollection.createShelves( 11.0f, 15.5f, 2.5f, 70.0f  ),
                    ShooterWallCollection.createShelves( 11.0f, 18.0f, 2.5f, 90.0f  ),
                    ShooterWallCollection.createShelves( 11.0f, 20.5f, 2.5f, 100.0f ),

                    //box
                    new WallCollection
                    (
                        ShooterWallCollection.createCrate(      5.5f, 16.5f, 2.5f, 100.0f, Scalation.ETriple ),
                        new Wall[] { ShooterWallCollection.createCrate0.0f, 0.0f, 0.66f, 10.0f, Scalation.ETriple ), }
                    ),

                    //box
                    new WallCollection
                    (
                        ShooterWallCollection.createCrate(      6.5f, 18.5f, 2.5f, 90.0f, Scalation.ETriple ),
                        new Wall[] { ShooterWallCollection.createCrate0.0f, 0.0f, 0.66f, -10.0f, Scalation.ETriple ), }
                    ),
                },

                //1st floor - casino
                new WallCollection[]
                {
                    //hallway
                    ShooterWallCollection.createRoom
                    (
                        4.0f, 24.0f, 2.5f, 0.0f, 4, 4,
                        WallStyle.ESolidWall, WallStyle.ESolidWall, WallStyle.ENoWall, WallStyle.ESolidWall,
                        WallTex.EGlass1, WallHealth.ESolidGlass, WallAction.EDoorSlideRight,
                        DoorStyle.ENoDoor, 0,
                        WALL_OFFICE, CARPET_OFFICE, WallTex.ECeiling1,
                        new Wall[]
                        {
                        },
                        null,
                        null,
                        new int[] { 1, },
                        null
                    ),

                    //hallway
                    ShooterWallCollection.createRoom
                    (
                        4.0f, 38.0f, 2.5f, 0.0f, 4, 4,
                        WallStyle.ENoWall, WallStyle.ESolidWall, WallStyle.ESolidWall, WallStyle.ESolidWall,
                        WallTex.EGlass1, WallHealth.ESolidGlass, WallAction.EDoorSlideRight,
                        DoorStyle.ENoDoor, 0,
                        WALL_OFFICE, CARPET_OFFICE, WallTex.ECeiling1,
                        new Wall[]
                        {
                        },
                        null,
                        null,
                        null,
                        new int[] { 1, }
                    ),

                    //casino
                    ShooterWallCollection.createRoom
                    (
                        4.0f, 28.0f, 2.5f, 0.0f, 8, 10,
                        WallStyle.ESolidWall, WallStyle.ESolidWall, WallStyle.ESolidWall, WallStyle.EWindowsAndCeilingWindows,
                        WallTex.EGlass1, WallHealth.ESolidGlass, WallAction.EDoorSlideRight,
                        DoorStyle.ENoDoor, 0,
                        WALL_OFFICE, CARPET_OFFICE, WallTex.ECeiling1,
                        new Wall[]
                        {
                            new Wall(   Others.ESodaMachine1,   new LibVertex( 6.5f, 0.3f, 0.0f ), 270.0f, Scalation.ENone,   Invert.ENo,  WallCollidable.EYes, WallAction.ENone,   WallClimbable.ENo, DrawMethod.EAlwaysDraw, WallTex.ESodaMachine2, null, 0, WallHealth.EVendingMachine, FXSize.ELarge, SoundFg.EExplosion1 ),
                            new Wall(   Others.ESodaMachine1,   new LibVertex( 6.5f, 9.7f, 0.0f ), 90.0f,  Scalation.ENone,   Invert.ENo,  WallCollidable.EYes, WallAction.ENone,   WallClimbable.ENo, DrawMethod.EAlwaysDraw, WallTex.ESodaMachine3, null, 0, WallHealth.EVendingMachine, FXSize.ELarge, SoundFg.EExplosion1 ),
                            new Sprite( Others.ESprite1,        new LibVertex( 5.0f, 0.4f, 0.0f ), Scalation.EAddThird,   WallCollidable.EYes, WallTex.EPlant1 ),
                            new Sprite( Others.ESprite1,        new LibVertex( 5.0f, 9.6f, 0.0f ), Scalation.EAddThird,   WallCollidable.EYes, WallTex.EPlant1 ),


/*
 
View Full Code Here

Examples of oop13.space.model.Wall

      }
    }
   
    //Testing collisions Shot -> Wall and Alien shot -> Wall
    ShipShot shipShot = new ShipShot(40, 450);
    Wall wallKicked = null;
    model.getList().add(shipShot);
    for (Wall wall : model.getWalls().getList()) {
      wall.collideWith(model.getList());
    }
    for (Wall wall : model.getWalls().getList()) {
      if (wall.getPositionX() == 40 && wall.getPositionY() == 450) {
        wallKicked = wall;
      }
    }
    Assert.assertTrue(wallKicked.getLives() == 1);
    model.getList().remove(shipShot);
    AlienShot alienShot = new AlienShot(35, 450);
    model.getList().add(alienShot);
    wallKicked.collideWith(model.getList());
    Assert.assertTrue(wallKicked.getLives() == 0);
    Assert.assertTrue(wallKicked.isDead());
   
    //Testing collisions Shot -> Alien Shot
    model.getList().add(shipShot);
    alienShot.collideWith(model.getList());
    Assert.assertTrue(shipShot.isDead());
View Full Code Here

Examples of oop13.space.model.Wall

    this.alien4 = new AlienMotherShip();
    this.alien4.moveTo(startPositionX, POSITION_Y);
    startPositionX += DELTA_X;
    this.alienShot = new AlienShot(startPositionX, POSITION_Y);
    startPositionX += DELTA_X;
    this.wall = new Wall(startPositionX);
    this.wall.moveTo(startPositionX, POSITION_Y);

    this.listIndividuals.add(spaceShip);
    this.listIndividuals.add(alien1);
    this.listIndividuals.add(alien2);
View Full Code Here

Examples of org.jgroups.demo.tankwar.model.Wall

    System.out.println("\n---- " + prompt + " -----\n");

    Map<String, Wall> test = new HashMap<String, Wall>();

    for (int i = 0; i < 6; i++) {
      test.put("key-" + i, new Wall(i, i, i, i));
    }

    System.out.println(test);

    try {
View Full Code Here

Examples of org.jgroups.demo.tankwar.model.Wall

    System.out.println("\n---- " + prompt + " -----\n");

    Map<String, Wall> test = new ConcurrentHashMap<String, Wall>();

    for (int i = 0; i < 6; i++) {
      test.put("key-" + i, new Wall(i, i, i, i));
    }

    System.out.println(test);

    try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.