diff --git a/cicaprojekt/Box.java b/cicaprojekt/Box.java index 01875b6..3a773a3 100644 --- a/cicaprojekt/Box.java +++ b/cicaprojekt/Box.java @@ -2,32 +2,14 @@ package cicaprojekt; public class Box implements cicaprojekt.Pickable, cicaprojekt.Destroyable { - private int weight; - public Box(int w){ + public Box(){ Menu.addTab(); - System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.Box(" + w + ")"); - weight = w; + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.Box()"); System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.Box()"); Menu.removeTab(); } - public int getWeight(){ - Menu.addTab(); - System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.getWeight()"); - return weight; - System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.getWeight()"); - Menu.removeTab(); - } - - public void setWeight(int w){ - Menu.addTab(); - System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.setWeight(" + w + ")"); - weight = w; - System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.setWeight()"); - Menu.removeTab(); - } - public void destroy() { Menu.addTab(); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.destroy()"); @@ -41,4 +23,13 @@ public class Box implements cicaprojekt.Pickable, cicaprojekt.Destroyable System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.pick()"); Menu.removeTab(); } + + @Override + public int weight() { + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.weight()"); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.weight()"); + Menu.removeTab(); + return 5; + } }