Procházet zdrojové kódy

changed store and storable interface

mpierse před 6 roky
rodič
revize
1d17a23766

+ 2
- 1
src/main/java/com/zipcodewilmington/froilansfarm/Animals/Amimal.java Zobrazit soubor

@@ -3,8 +3,9 @@ package com.zipcodewilmington.froilansfarm.Animals;
3 3
 import com.zipcodewilmington.froilansfarm.Eater;
4 4
 import com.zipcodewilmington.froilansfarm.Edible;
5 5
 import com.zipcodewilmington.froilansfarm.NoiseMaker;
6
+import com.zipcodewilmington.froilansfarm.Storeable;
6 7
 
7
-public class Amimal implements NoiseMaker, Eater {
8
+public class Amimal implements NoiseMaker, Eater, Storeable {
8 9
 
9 10
 
10 11
     public String makeNoise(){

+ 9
- 0
src/main/java/com/zipcodewilmington/froilansfarm/Farmer.java Zobrazit soubor

@@ -1,6 +1,15 @@
1 1
 package com.zipcodewilmington.froilansfarm;
2 2
 
3
+import com.zipcodewilmington.froilansfarm.Holders.Storer;
3 4
 import com.zipcodewilmington.froilansfarm.PlantsAndCrops.Botanist;
4 5
 
5 6
 public class Farmer extends Person implements Harvests, Botanist {
7
+
8
+    public void collectYeild(Storeable storeType, Storer storeBuilding) {
9
+
10
+        addToStore(storeType, storeBuilding);
11
+
12
+    }
13
+
14
+
6 15
 }

+ 1
- 1
src/main/java/com/zipcodewilmington/froilansfarm/Harvests.java Zobrazit soubor

@@ -2,6 +2,6 @@ package com.zipcodewilmington.froilansfarm;
2 2
 
3 3
 public interface Harvests {
4 4
 
5
-    
5
+    void collectYeild();
6 6
 
7 7
 }

+ 4
- 0
src/main/java/com/zipcodewilmington/froilansfarm/Holders/Storer.java Zobrazit soubor

@@ -1,4 +1,8 @@
1 1
 package com.zipcodewilmington.froilansfarm.Holders;
2 2
 
3
+import com.zipcodewilmington.froilansfarm.Storeable;
4
+
3 5
 public interface Storer {
6
+
7
+    void addToStore(Storeable itemToStore);
4 8
 }

+ 8
- 0
src/main/java/com/zipcodewilmington/froilansfarm/Storeable.java Zobrazit soubor

@@ -0,0 +1,8 @@
1
+package com.zipcodewilmington.froilansfarm;
2
+
3
+import com.zipcodewilmington.froilansfarm.Holders.Storer;
4
+
5
+public interface Storeable {
6
+
7
+    void addToStore(Storeable storeType, Storer storeBuilding);
8
+}

+ 3
- 0
src/main/java/com/zipcodewilmington/froilansfarm/Vehicle/Tractor.java Zobrazit soubor

@@ -8,6 +8,9 @@ public class Tractor extends Vehicle implements Harvests, FarmVehicle {
8 8
         return true;
9 9
     }
10 10
 
11
+    public void collectYeild(storeType) {
11 12
 
13
+        addToStore();
12 14
 
15
+    }
13 16
 }