From 1e84ed2bc3c85385c0fbdb6369eba9907819a068 Mon Sep 17 00:00:00 2001 From: Gregory Date: Tue, 4 Feb 2014 18:31:34 +0800 Subject: [PATCH 1/2] Update Potato.java --- src/main/java/org/drtshock/Potato.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/drtshock/Potato.java b/src/main/java/org/drtshock/Potato.java index bf3a72b..9941f39 100644 --- a/src/main/java/org/drtshock/Potato.java +++ b/src/main/java/org/drtshock/Potato.java @@ -15,7 +15,7 @@ public class Potato implements Tuber { } 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"); return this.isDelicious(); } From a2f70b155b51ee9acd47bb4977a92ce5817569d0 Mon Sep 17 00:00:00 2001 From: Ivan Ip Date: Fri, 14 Feb 2014 00:39:22 +0800 Subject: [PATCH 2/2] Update Potato.java-- added an oven. --- src/main/java/org/drtshock/Potato.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/drtshock/Potato.java b/src/main/java/org/drtshock/Potato.java index 9941f39..6733a5b 100644 --- a/src/main/java/org/drtshock/Potato.java +++ b/src/main/java/org/drtshock/Potato.java @@ -2,6 +2,7 @@ package org.drtshock; import java.util.List; import java.util.ArrayList; +import java.net.HttpURLConnection; public class Potato implements Tuber { @@ -15,7 +16,7 @@ public class Potato implements Tuber { } public boolean prepare() { - this.addCondiments("sour cream", "chives", "butter", "crumbled bacon", "grated cheese", "ketchup", "salt"); + this.addCondiments("sour cream", "chives", "butter", "crumbled bacon", "grated cheese", "ketchup", "salt", "tabasco"); return this.isDelicious(); } @@ -24,10 +25,27 @@ public class Potato implements Tuber { for (String condimentName : names) condiments.add(new Condiment(condimentName)); } } + + 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 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