Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public BlockCommon getShape(String shapeType, String ID, float posX, float posY, float blockSizeX, float blockSizeY, float angle){
  2. if(getBlock(ID)!= null){
  3. remove(ID);
  4. }
  5. if(shapeType == null){
  6. return null;
  7. }
  8. if(shapeType.equalsIgnoreCase(SHAPE_RECTANGLE)){
  9. RectangleBlock rb = new RectangleBlock();
  10. rb.create(posX, posY, blockSizeX, blockSizeY, angle);
  11. blocks.add(rb);
  12. rb.setID(ID);
  13. return rb;
  14.  
  15. } else if(shapeType.equalsIgnoreCase(SHAPE_CURVE)) {
  16. CurveBlock c = new CurveBlock();
  17. c.create(posX, posY, blockSizeX, blockSizeY, angle);
  18. blocks.add(c);
  19. c.setID(ID);
  20. return c;
  21.  
  22.  
  23. return null;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement