Skip to content
Snippets Groups Projects
Commit 7faac365 authored by tildiko97's avatar tildiko97
Browse files

SimpleField: fluid + printStat

parent 842517d7
No related branches found
No related tags found
No related merge requests found
...@@ -113,18 +113,32 @@ public class SimpleField extends AbstractField { ...@@ -113,18 +113,32 @@ public class SimpleField extends AbstractField {
public double getFriction() { public double getFriction() {
return friction; return friction;
} }
@Override
public String toString() {
return "no fluid";
}
} }
protected class Oil extends Fluid { protected class Oil extends Fluid {
Oil() { Oil() {
friction = 0; friction = 0;
} }
@Override
public String toString() {
return "Oil";
}
} }
protected class Honey extends Fluid { protected class Honey extends Fluid {
Honey() { Honey() {
friction = 2; friction = 2;
} }
@Override
public String toString() {
return "Honey";
}
} }
public void putOil() { public void putOil() {
...@@ -139,7 +153,7 @@ public class SimpleField extends AbstractField { ...@@ -139,7 +153,7 @@ public class SimpleField extends AbstractField {
{ {
super.printStat(); super.printStat();
System.out.println("moveable: " + Main.getMoveableName(myMoveable)); System.out.println("moveable: " + Main.getMoveableName(myMoveable));
System.out.println("fluid: " + fluid); System.out.println("fluid: " + fluid.toString());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment