Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

J feature #51

Open
wants to merge 148 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
5e9a0b4
made eater and noiseMaker interfaces
Jul 20, 2021
a6efced
Merge pull request #1 from Agate-Acres/feature/eat
tnguyen1912 Jul 20, 2021
2af5afe
Added 2 classes
JeremySabina Jul 20, 2021
404a694
Merge pull request #2 from Agate-Acres/JFeature
JeremySabina Jul 20, 2021
ec719f2
ridable interface
Jul 20, 2021
db85b17
added classes for shelter and Person and animal types
jgiroso Jul 20, 2021
2e41fa2
Merge pull request #3 from Agate-Acres/feature/eat
tnguyen1912 Jul 20, 2021
0b79280
Merge pull request #4 from Agate-Acres/feat/firstFeat
jgiroso Jul 20, 2021
ddd449e
Added all food classes
JeremySabina Jul 20, 2021
a8e37d4
Merge pull request #5 from Agate-Acres/JFeature
JeremySabina Jul 20, 2021
8e7d56b
edible interface
Jul 20, 2021
e79cf52
new stuff
Jul 20, 2021
9167e0d
Merge pull request #6 from Agate-Acres/feature/eat
tnguyen1912 Jul 20, 2021
cb74c34
Added vehicle classes and interfaces
Jul 20, 2021
f09981e
Merge pull request #7 from Agate-Acres/feature/VehicleInterfaces
ZachSinger Jul 20, 2021
2bda368
added methods to shelter classes
jgiroso Jul 21, 2021
df5ed4a
Merge pull request #8 from Agate-Acres/feat/shelterClasses
jgiroso Jul 21, 2021
87d877f
edited shelter variables
jgiroso Jul 21, 2021
59be4d4
Merge pull request #9 from Agate-Acres/feat/shelterEdits
jgiroso Jul 21, 2021
80202b0
Updated vehicle intefaces
Jul 21, 2021
fe8f114
Merge pull request #10 from Agate-Acres/feature/VehicleInterfaces
ZachSinger Jul 21, 2021
160a6b6
added more stuff
Jul 21, 2021
c83a462
Merge pull request #11 from Agate-Acres/feature/eat
tnguyen1912 Jul 21, 2021
7f95af8
added tests but need classes first
jgiroso Jul 21, 2021
672664d
Merge pull request #12 from Agate-Acres/feat/shelterTests
jgiroso Jul 21, 2021
089debb
edited eater
Jul 21, 2021
940bf26
Merge pull request #13 from Agate-Acres/feature/eat
tnguyen1912 Jul 21, 2021
98de612
Created farm class
Jul 21, 2021
9bf658f
Merge pull request #14 from Agate-Acres/feature/createFarm
ZachSinger Jul 21, 2021
a7c14fd
Farm
Jul 21, 2021
db6bd0c
added some implementations
JeremySabina Jul 21, 2021
14424ab
test
JeremySabina Jul 21, 2021
4c4f4b5
Merge pull request #15 from Agate-Acres/JFeature
JeremySabina Jul 21, 2021
08fa101
added FarmHouse test and changes to shelter classes
jgiroso Jul 21, 2021
d2d0050
Merge pull request #16 from Agate-Acres/feat/PersonClass
jgiroso Jul 21, 2021
b3c387d
various changes
Jul 21, 2021
bc354aa
Merge pull request #17 from Agate-Acres/feature/FarmFeatures
ZachSinger Jul 21, 2021
331b851
changed the edible to an interface
JeremySabina Jul 21, 2021
a69f094
test
JeremySabina Jul 21, 2021
ab38bb1
merging
JeremySabina Jul 21, 2021
11e4196
Merge pull request #19 from Agate-Acres/JFeature
JeremySabina Jul 21, 2021
284081d
added stable and chickenCoop tests
jgiroso Jul 21, 2021
acd6cb8
Merge pull request #20 from Agate-Acres/feat/moreShelterTests
jgiroso Jul 21, 2021
004b70d
added constructors to food
JeremySabina Jul 21, 2021
79c291a
Merge branch 'Dev' into JFeature
JeremySabina Jul 21, 2021
b157327
changed pom
JeremySabina Jul 21, 2021
6c4cb69
Merge pull request #21 from Agate-Acres/JFeature
JeremySabina Jul 21, 2021
73b86bf
person tests
jgiroso Jul 21, 2021
afb630b
Merge pull request #22 from Agate-Acres/feat/Botanist
jgiroso Jul 21, 2021
071108b
made eater generic
Jul 21, 2021
cd6a690
send it
Jul 21, 2021
13fbcc5
implemented Eater on Person. added Farmer Test
jgiroso Jul 21, 2021
8db54e1
Merge pull request #23 from Agate-Acres/feat/personImplements
jgiroso Jul 21, 2021
2c87d82
added packages
jgiroso Jul 21, 2021
fdad0d5
makeNoise override
Jul 21, 2021
30a7a7c
added Rideable
JeremySabina Jul 21, 2021
8bd83a0
hello
Jul 21, 2021
ca86be5
added instanceof tests
jgiroso Jul 21, 2021
b9f3352
Merge pull request #24 from Agate-Acres/feat/addingMoreStuff
jgiroso Jul 21, 2021
13d55d2
finished farmer class
Jul 21, 2021
4f5ba6a
Merge pull request #25 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
5addea1
made changes to interfaces
Jul 22, 2021
56c7a5a
added method
JeremySabina Jul 22, 2021
861f253
new stuff
Jul 22, 2021
c12933c
Merge pull request #26 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
062d722
added lotsa codes
Jul 22, 2021
8a44d90
Merge pull request #27 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
80fa18e
Mammal tests done
jgiroso Jul 22, 2021
3c9c66f
Merge pull request #28 from Agate-Acres/feat/moreStuffIdk
jgiroso Jul 22, 2021
4c82989
edited horse Test
jgiroso Jul 22, 2021
a780cae
Added a few tests
Jul 22, 2021
85b0628
Merge pull request #29 from Agate-Acres/feature/VehTests
ZachSinger Jul 22, 2021
f93211a
added a gew tests
JeremySabina Jul 22, 2021
a2b1a47
added all test names for food
JeremySabina Jul 22, 2021
a599649
Merge pull request #30 from Agate-Acres/JFeature
JeremySabina Jul 22, 2021
b418771
Added tests for Tractor
Jul 22, 2021
a39d1f7
Added some food tests
JeremySabina Jul 22, 2021
33c4b97
Merge branch 'Dev' into JFeature
JeremySabina Jul 22, 2021
15cae18
added some more food tests
JeremySabina Jul 22, 2021
925df54
Merge pull request #31 from Agate-Acres/JFeature
JeremySabina Jul 22, 2021
9b58988
chickenTests, chicken Class, and egg Class updated
jgiroso Jul 22, 2021
160e990
Merge pull request #32 from Agate-Acres/feat/whoKnowsAnymore
jgiroso Jul 22, 2021
d1bb877
changed cropRow
Jul 22, 2021
14826d8
Merge pull request #33 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
d0ff627
added tests to mammal class
jgiroso Jul 22, 2021
10f73c0
Merge pull request #34 from Agate-Acres/feat/moreMammalTests
jgiroso Jul 22, 2021
f91ebf9
fixed cornstalk
Jul 22, 2021
9ac7950
Merge pull request #35 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
615b48b
Farmer Tests Complete
jgiroso Jul 22, 2021
e9bbb1c
Merge pull request #36 from Agate-Acres/feat/FarmerTests
jgiroso Jul 22, 2021
c956498
cornstalk and croprow tests finished
Jul 22, 2021
19a1155
Merge pull request #37 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
c429a47
Structure tests complete
jgiroso Jul 22, 2021
f52f1aa
Merge pull request #38 from Agate-Acres/feat/moreMammalTests
jgiroso Jul 22, 2021
980ed56
the plot chickens
Jul 22, 2021
3611566
edited person and farmer methods
jgiroso Jul 22, 2021
a225646
Merge pull request #39 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
fe40f63
Merge pull request #40 from Agate-Acres/feat/PersonTests
jgiroso Jul 22, 2021
b35cf7b
moved eat method from chicken and horse to Animal class only
jgiroso Jul 22, 2021
2c05a4d
Merge pull request #41 from Agate-Acres/feat/playingWithGenerics
jgiroso Jul 22, 2021
1c10ce3
added implementation test to PersonTests
jgiroso Jul 22, 2021
31f7043
Merge pull request #42 from Agate-Acres/feat/finalPersonTest
jgiroso Jul 22, 2021
3264514
Further testing on vehicles
Jul 22, 2021
d55f921
Merge pull request #43 from Agate-Acres/feature/FurtherVehicleTests
ZachSinger Jul 22, 2021
a06a992
took out some tests
Jul 22, 2021
e6bcc23
food package is done
Jul 22, 2021
0e259cd
Merge pull request #44 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
0afbf43
woo
JeremySabina Jul 22, 2021
4c6604b
Started Simulation
JeremySabina Jul 22, 2021
90a8eff
Testing stuff
Jul 22, 2021
62c5db2
Merge branch 'Dev' into JFeature
JeremySabina Jul 22, 2021
c8b6dbd
Merge pull request #45 from Agate-Acres/JFeature
JeremySabina Jul 22, 2021
6e3e6e8
Merge pull request #46 from Agate-Acres/feature/EvenMoreVehicleTesting
ZachSinger Jul 22, 2021
fe9e13f
oops
Jul 22, 2021
e822d2f
did on dev again
Jul 22, 2021
8640b74
Simulation stuff?
JeremySabina Jul 22, 2021
c583b4c
Merge branch 'JFeature' of https://github.com/Agate-Acres/Maven.Farme…
JeremySabina Jul 22, 2021
1431072
Merge pull request #47 from Agate-Acres/JFeature
JeremySabina Jul 22, 2021
c9da791
Carrot classes and tests added
jgiroso Jul 22, 2021
e965ac2
Merge pull request #48 from Agate-Acres/feat/Carrot
jgiroso Jul 22, 2021
50bfa3d
croprow harvest method
Jul 22, 2021
4428f14
Merge pull request #49 from Agate-Acres/feature/eat
tnguyen1912 Jul 22, 2021
b853e37
heyo
JeremySabina Jul 22, 2021
9fcdfe7
Merge branch 'Dev' into JFeature
JeremySabina Jul 22, 2021
8935fff
Edits to farm, tractor, tractorHarvestTest
Jul 23, 2021
926bc43
Finished Establishing the plot
JeremySabina Jul 23, 2021
8e416a1
Merge pull request #50 from Agate-Acres/feature/FinishVehicleTests
ZachSinger Jul 23, 2021
45141be
Merge branch 'Dev' into JFeature
JeremySabina Jul 23, 2021
ad917e0
Merge pull request #51 from Agate-Acres/JFeature
JeremySabina Jul 23, 2021
6d30531
changed croprow
Jul 23, 2021
b2fc849
help me
JeremySabina Jul 23, 2021
48ca115
Merge branch 'JFeature' of https://github.com/Agate-Acres/Maven.Farme…
JeremySabina Jul 23, 2021
dda5b29
help
JeremySabina Jul 23, 2021
635853e
Merge pull request #52 from Agate-Acres/JFeature
JeremySabina Jul 23, 2021
3513174
split chickens and horses
Jul 23, 2021
96a2b26
implemented split changes
Jul 23, 2021
d45e354
edited croprow
Jul 23, 2021
0a43911
Merge pull request #53 from Agate-Acres/feature/eat
tnguyen1912 Jul 23, 2021
7cd3210
hello
JeremySabina Jul 23, 2021
3e01090
Froilan class added
jgiroso Jul 23, 2021
d3dee15
Merge pull request #54 from Agate-Acres/feat/Froilan
jgiroso Jul 23, 2021
a8af06e
Merge branch 'Dev' into JFeature
JeremySabina Jul 23, 2021
89de06c
Merge pull request #56 from Agate-Acres/JFeature
JeremySabina Jul 23, 2021
688308f
moved VehicleTests
jgiroso Jul 23, 2021
c8052ad
Merge pull request #57 from Agate-Acres/feat/smallEdits
jgiroso Jul 23, 2021
d3835b2
Tests added for vehicles
Jul 23, 2021
3a04bef
hello there
JeremySabina Jul 23, 2021
38fd68e
Merge branch 'Dev' into JFeature
JeremySabina Jul 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
<groupId>com.zipcodewilmington</groupId>
<artifactId>froilans-farm</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>


</project>
10 changes: 10 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Botanist.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.zipcodewilmington.froilansfarm;

import com.zipcodewilmington.froilansfarm.Food.Crop;
import com.zipcodewilmington.froilansfarm.Food.CropRow;

public interface Botanist {

void plant(Crop crop, CropRow cropRow);

}
7 changes: 7 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Eater.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.zipcodewilmington.froilansfarm;

import com.zipcodewilmington.froilansfarm.Edible;

public interface Eater < T extends Edible > {
void eat(T edible);
}
5 changes: 5 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Edible.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.zipcodewilmington.froilansfarm;

public interface Edible {

}
44 changes: 44 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Farm.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.zipcodewilmington.froilansfarm;

import com.zipcodewilmington.froilansfarm.Food.CropRow;
import com.zipcodewilmington.froilansfarm.Mammal.Chicken;
import com.zipcodewilmington.froilansfarm.Mammal.Farmer;
import com.zipcodewilmington.froilansfarm.Mammal.Horse;
import com.zipcodewilmington.froilansfarm.Mammal.Person;
import com.zipcodewilmington.froilansfarm.Structure.ChickenCoop;
import com.zipcodewilmington.froilansfarm.Structure.FarmHouse;
import com.zipcodewilmington.froilansfarm.Structure.Stable;

public class Farm {
private Shelter<Person> farmhouse = new FarmHouse();
private Shelter<Horse> stable = new Stable();
private Shelter<Chicken> chickenCoop = new ChickenCoop();
private Field field = new Field();

public Farm(){
farmhouse.add(new Farmer("Froilan"));
farmhouse.add(new Farmer("Froilanda"));
stable.add(new Horse("Fork"));
stable.add(new Horse("Spoon"));
chickenCoop.add(new Chicken("Chicolate"));
chickenCoop.add(new Chicken("Eggward"));
field.add(new CropRow());
field.add(new CropRow());
}

public Shelter<Person> getFarmhouse() {
return farmhouse;
}

public Shelter<Horse> getStable() {
return stable;
}

public Shelter<Chicken> getChickenCoop() {
return chickenCoop;
}

public Field getField(){
return field;
}
}
19 changes: 19 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Field.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.zipcodewilmington.froilansfarm;
import com.zipcodewilmington.froilansfarm.Food.CropRow;

import java.util.ArrayList;
import java.util.List;

public class Field {

private List<CropRow> myField = new ArrayList<>();


public void add(CropRow row){
myField.add(row);
}

public List<CropRow> getMyField() {
return myField;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Edible;

public class Carrot implements Edible {

public Carrot() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.zipcodewilmington.froilansfarm.Food;

public class CarrotFlower extends Crop{

public CarrotFlower(Integer id){
super(id);
}

public CarrotFlower(){
}

@Override
public Carrot yield () {
if(this.checkFertilized() && !this.checkHarvested()){ // does check harvested have to be false in order to harvest th corn?
this.setHarvested(true);
return new Carrot();
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.zipcodewilmington.froilansfarm.Food;

public class CornStalk extends Crop {

public CornStalk(Integer id){
super(id);
}

public CornStalk(){
}

@Override
public EarCorn yield () {
if(this.checkFertilized() && !this.checkHarvested()){ // does check harvested have to be false in order to harvest th corn?
this.setHarvested(true);
return new EarCorn();
}
return null;
}

}
45 changes: 45 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Food/Crop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Edible;

public abstract class Crop implements Produce {
private Boolean fertilized;
private Boolean isHarvested;
private Integer id;

public Crop(Integer id) {
this.fertilized = false;
this.isHarvested = false;
this.id = id;
}

public Crop() {
this.fertilized = false;
this.isHarvested = false;
this.id = null;
}


public void fertilize(){
this.fertilized = true;
}

@Override
abstract public Edible yield();

public Boolean checkFertilized() {
return fertilized;
}

public Boolean checkHarvested() {
return isHarvested;
}

public void setHarvested(Boolean harvested) {
isHarvested = harvested;
}

public Integer getId() {
return id;
}
}
46 changes: 46 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Food/CropRow.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Edible;

import java.util.ArrayList;
import java.util.List;

public class CropRow {
private List<Crop> cropList;

public CropRow() {
cropList = new ArrayList<>();
}

public void plantCrop(Crop crop) {
this.cropList.add(crop);
}

public Integer getNumberOfCrops() {
return cropList.size();
}

public Crop getCropById(Integer id) {
Crop result = null;
for (Crop crop : cropList) {
result = id == crop.getId() ? crop : null;
}
return result;
}


public void fertilizeRow() {
cropList.forEach(Crop::fertilize);
}

public ArrayList<Edible> harvestRow() {
ArrayList<Edible> harvest = new ArrayList<>();
cropList.forEach(crop -> {
harvest.add(crop.yield());
crop.setHarvested(true);
});
return harvest;
}


}
12 changes: 12 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Food/EarCorn.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Edible;

public class EarCorn implements Edible {

public EarCorn() {
}



}
20 changes: 20 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Food/Egg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Edible;

public class Egg implements Edible {

private boolean isFertilized;

public Egg() {
isFertilized = false;
}

public boolean isItFertilized() {
return isFertilized;
}

public void setIsFertilized(boolean fertilize) {
this.isFertilized = fertilize;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Edible;

public interface Produce {
Boolean isFertilized = null;
Edible yield();
}
10 changes: 10 additions & 0 deletions src/main/java/com/zipcodewilmington/froilansfarm/Food/Tomato.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Edible;

public class Tomato implements Edible {

public Tomato() {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.zipcodewilmington.froilansfarm.Food;

import com.zipcodewilmington.froilansfarm.Food.Crop;
import com.zipcodewilmington.froilansfarm.Food.Tomato;

public class TomatoPlant extends Crop {

public TomatoPlant(Integer id) {
super(id);
}

public TomatoPlant() {
}

@Override
public Tomato yield() {
if(this.checkFertilized() && !this.checkHarvested()){
this.setHarvested(true);
return new Tomato();
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
package com.zipcodewilmington.froilansfarm;

import com.zipcodewilmington.froilansfarm.Mammal.Animal;
import com.zipcodewilmington.froilansfarm.Mammal.Chicken;
import com.zipcodewilmington.froilansfarm.Mammal.Farmer;
import com.zipcodewilmington.froilansfarm.Mammal.Person;

/**
* Created by leon on 2/26/18.
*/
public class MainApplication {
public class MainApplication{

public static void main(String[] args) {
run();
}

public static void run() {
Person person1 = new Person();
System.out.println(person1.makeNoise());
Animal chicken1 = new Chicken();
System.out.println(chicken1.makeNoise());
Person farmer1 = new Farmer();
System.out.println(farmer1.makeNoise());

}


}
Loading