Added weight to Box, + getter/setter
This commit is contained in:
parent
ab02de6e86
commit
a83a849ac0
@ -2,19 +2,23 @@ package cicaprojekt;
|
|||||||
|
|
||||||
public class Box implements cicaprojekt.Pickable, cicaprojekt.Destroyable
|
public class Box implements cicaprojekt.Pickable, cicaprojekt.Destroyable
|
||||||
{
|
{
|
||||||
|
private int weight;
|
||||||
|
|
||||||
|
public Box(int w){
|
||||||
|
weight = w;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWeight(){
|
||||||
|
return weight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWeight(int w){
|
||||||
|
weight = w;
|
||||||
|
}
|
||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
Menu.addTab();
|
|
||||||
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.destroy()");
|
|
||||||
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.destroy()");
|
|
||||||
Menu.removeTab();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pick() {
|
public void pick() {
|
||||||
Menu.addTab();
|
|
||||||
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.pick()");
|
|
||||||
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.pick()");
|
|
||||||
Menu.removeTab();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user