Merge pull request #28 from lifehome/master
We do bake potatoes, don't we?
This commit is contained in:
commit
b3d4b50749
1 changed files with 20 additions and 2 deletions
|
@ -2,6 +2,7 @@ package org.drtshock;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
|
||||||
public class Potato implements Tuber {
|
public class Potato implements Tuber {
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ public class Potato implements Tuber {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean prepare() {
|
public boolean prepare() {
|
||||||
this.addCondiments("sour cream", "chives", "butter", "crumbled bacon", "grated cheese", "ketchup");
|
this.addCondiments("sour cream", "chives", "butter", "crumbled bacon", "grated cheese", "ketchup", "salt", "tabasco");
|
||||||
return this.isDelicious();
|
return this.isDelicious();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +26,26 @@ public class Potato implements Tuber {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPutintoOven {
|
||||||
|
URL url = new URL("https://www.google.com/");
|
||||||
|
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
|
||||||
|
connection.setRequestMethod("GET");
|
||||||
|
connection.connect();
|
||||||
|
|
||||||
|
int inOven = connection.getResponseCode();
|
||||||
|
if (inOven == 200) return true; // you need to put into an oven before bake it.
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBaked() {
|
||||||
|
if(this.isPutintoOven) return true;
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDelicious() {
|
public boolean isDelicious() {
|
||||||
return true; // obviously, potatos are always delicious
|
if(isBaked) return true; // this way we could move on to our condiments. =D
|
||||||
|
else return false; // you don't eat a raw potato, don't you?
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue