aleantorcha

Untitled

Nov 21st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. /**
  2. * Class for the Door Builders
  3. * By: Alejandro Antorcha
  4. */
  5. package Lesson3;
  6.  
  7. public class DoorBuilder extends Constructicon {
  8.  
  9. public DoorBuilder(int x, int y, Direction d, int b) {
  10. super(x, y, d, b);
  11. }
  12.  
  13. /**
  14. * Builds one piece of he door
  15. * @param
  16. * @return void
  17. */
  18. public void piece(int height) {
  19. putBeeper();
  20. if(height < 3) {
  21. move();
  22. }
  23. }
  24.  
  25. /**
  26. * Builds the side of the door
  27. * @param
  28. * @return void
  29. */
  30. public void sideBuild() {
  31. for(int i = 0; i < 4; i++) {
  32. piece(i);
  33. }
  34. }
  35.  
  36. /**
  37. * Builds the top of the door
  38. * @param
  39. * @return void
  40. */
  41. public void topBuild() {
  42. turnLeft();
  43. move();
  44. putBeeper();
  45. move();
  46. turnLeft();
  47. }
  48.  
  49. /**
  50. * Builds a door
  51. * @param
  52. * @return void
  53. */
  54. public void build() {
  55. sideBuild();
  56. topBuild();
  57. sideBuild();
  58. }
  59.  
  60. }
Add Comment
Please, Sign In to add comment