Added weight to Box, + getter/setter

This commit is contained in:
muskenum 2016-04-21 23:01:20 +02:00
parent ab02de6e86
commit a83a849ac0

View File

@ -2,19 +2,23 @@ package cicaprojekt;
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() {
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() {
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.pick()");
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Box.pick()");
Menu.removeTab();
}
}