Browse Source

strange errors on my ridable interface

mpierse 6 years ago
parent
commit
a6e45e077f

+ 2
- 2
src/main/java/com/zipcodewilmington/froilansfarm/Animals/Egg.java View File

10
     private boolean isFertilized = false;
10
     private boolean isFertilized = false;
11
 
11
 
12
 
12
 
13
-    public boolean getisFertilized() {
13
+    public boolean getIsFertilized() {
14
         return isFertilized;
14
         return isFertilized;
15
     }
15
     }
16
     public boolean setIsFertilized(boolean rooster) {
16
     public boolean setIsFertilized(boolean rooster) {
19
     }
19
     }
20
 
20
 
21
     public boolean isEdible(){
21
     public boolean isEdible(){
22
-        return !isFertilized();
22
+        return !getIsFertilized();
23
     };
23
     };
24
 
24
 
25
     public void foodIsEaten(int numberEaten){
25
     public void foodIsEaten(int numberEaten){

+ 8
- 8
src/main/java/com/zipcodewilmington/froilansfarm/Animals/Horse.java View File

19
         return true;
19
         return true;
20
     }
20
     }
21
 
21
 
22
-    public String ride(){
23
-        String result = "";
24
-        if (isRideable() && rider.getIsMounted())
25
-            for (int i=0; i<stable.getHorses(); i++) {
26
-            result += "Horse number " + i + " has been ridden today. \n";
22
+    public String ride() {
23
+        String result = "No riding today";
24
+        if (getIsRideable() && rider.getIsMounted()) {
25
+            result = "";
26
+            for (int i = 0; i < stable.getHorses(); i++) {
27
+                result += "Horse number " + i + " has been ridden today. \n";
28
+            }
27
         }
29
         }
30
+
28
         return result;
31
         return result;
29
     }
32
     }
30
 
33
 
31
-
32
-
33
-
34
 }
34
 }

+ 1
- 1
src/main/java/com/zipcodewilmington/froilansfarm/Fertilizable.java View File

2
 
2
 
3
 public interface Fertilizable {
3
 public interface Fertilizable {
4
 
4
 
5
-    boolean isFertilized();
5
+    boolean getIsFertilized();
6
 
6
 
7
 }
7
 }

+ 3
- 0
src/main/java/com/zipcodewilmington/froilansfarm/Holders/CropRow.java View File

1
 package com.zipcodewilmington.froilansfarm.Holders;
1
 package com.zipcodewilmington.froilansfarm.Holders;
2
 
2
 
3
 public class CropRow extends Field {
3
 public class CropRow extends Field {
4
+
5
+
6
+
4
 }
7
 }

+ 3
- 1
src/main/java/com/zipcodewilmington/froilansfarm/Ridable.java View File

2
 
2
 
3
 public interface Ridable {
3
 public interface Ridable {
4
 
4
 
5
-    boolean isRideable();
5
+    boolean getIsRideable();
6
+
7
+    String ride();
6
 
8
 
7
 
9
 
8
 
10
 

+ 6
- 1
src/main/java/com/zipcodewilmington/froilansfarm/Vehicle/Vehicle.java View File

9
         return "VROOM VROOM!";
9
         return "VROOM VROOM!";
10
     }
10
     }
11
 
11
 
12
-    public boolean isRideable(){
12
+    public boolean getIsRideable(){
13
         return true;
13
         return true;
14
     }
14
     }
15
 
15
 
16
+    public String ride(){
17
+     return "Moving around on a vehicle";
18
+    };
19
+
20
+
16
 }
21
 }