From d60400b5f490a34289756e1730d3a8decad22391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sat, 23 Apr 2016 13:15:30 +0200 Subject: [PATCH] minor refactor regarding Box.weight(), weight is now also an attribute --- cicaprojekt/Box.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cicaprojekt/Box.java b/cicaprojekt/Box.java index 3a773a3..4303b3d 100644 --- a/cicaprojekt/Box.java +++ b/cicaprojekt/Box.java @@ -2,6 +2,8 @@ package cicaprojekt; public class Box implements cicaprojekt.Pickable, cicaprojekt.Destroyable { + private int weight = 5; + public Box(){ Menu.addTab(); @@ -30,6 +32,6 @@ public class Box implements cicaprojekt.Pickable, cicaprojekt.Destroyable System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.weight()"); System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.weight()"); Menu.removeTab(); - return 5; + return this.weight; } }