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

Dev #1

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
ae1306f
starter
Nov 24, 2023
bfb4c11
Merge pull request #1 from ZipcodeBraeburn/tam
TamMDoan Nov 24, 2023
62ad303
start working
Nov 24, 2023
69e2860
space
TevinGlover Nov 25, 2023
b7a1fb7
Merge pull request #2 from TevinGlover/Tevin
Christy-ED Nov 25, 2023
7e8da67
Merge pull request #3 from ZipcodeBraeburn/christy
Christy-ED Nov 25, 2023
d9321dd
noiseMaker
TevinGlover Nov 25, 2023
6675274
edible
TevinGlover Nov 25, 2023
843dd0b
Merge pull request #4 from TevinGlover/Tevin
TevinGlover Nov 25, 2023
18e2ab5
animal
TevinGlover Nov 25, 2023
f7e4120
Merge pull request #5 from ZipcodeBraeburn/Tevin
TevinGlover Nov 25, 2023
a07b77d
generic in rideable
Nov 25, 2023
39b06eb
edibleCrops extends edible
Nov 25, 2023
e547957
vehicle extending noisemaker, rideable
Nov 25, 2023
f30a9ba
Merge pull request #6 from ZipcodeBraeburn/tam
TamMDoan Nov 25, 2023
bcdbd7d
FarmVehicule done
Nov 25, 2023
2cc9542
Merge pull request #7 from ZipcodeBraeburn/Christy1
Christy-ED Nov 25, 2023
fd9fff9
hasBeenHarvested
Nov 25, 2023
0ec11d5
Merge pull request #8 from ZipcodeBraeburn/tam
TamMDoan Nov 25, 2023
98d781f
the tri
TevinGlover Nov 25, 2023
507060c
Merge pull request #9 from ZipcodeBraeburn/Tevin
TevinGlover Nov 25, 2023
daa865b
abstract
Nov 25, 2023
a53b8ac
abstract
Nov 25, 2023
0e8a5f0
Merge pull request #10 from ZipcodeBraeburn/Christy2
Christy-ED Nov 25, 2023
e636a96
created empty test files for week tests
Nov 25, 2023
b236be4
abstracts, turned crop into interface
Nov 25, 2023
9677b5a
aircraft, minor change to vehicle
Nov 25, 2023
87100de
Merge pull request #11 from ZipcodeBraeburn/tam
TamMDoan Nov 25, 2023
1326f81
added generic to animal
Nov 25, 2023
b50688d
Merge pull request #12 from ZipcodeBraeburn/tam
TamMDoan Nov 25, 2023
64a0291
chicken
TevinGlover Nov 26, 2023
f039ccc
Edible Done for now
TevinGlover Nov 26, 2023
84daa9e
Merge pull request #13 from ZipcodeBraeburn/Tevin
TevinGlover Nov 26, 2023
b0d7c22
CropDuster Test
Nov 26, 2023
ec3238f
working Test
Nov 26, 2023
1f11072
working Test
Nov 26, 2023
c0e10a3
working Test
Nov 26, 2023
7b9c556
Merge pull request #14 from ZipcodeBraeburn/christy
Christy-ED Nov 26, 2023
a757a4c
working Test
Nov 26, 2023
4d43556
Merge pull request #15 from ZipcodeBraeburn/christy
Christy-ED Nov 26, 2023
f2702b3
chickencoop & cornstorage methods + tests
Nov 26, 2023
c91658b
eggstorage methods + tests
Nov 26, 2023
07c41c4
storage methods + tests
Nov 26, 2023
8d06e0b
Merge pull request #16 from ZipcodeBraeburn/tam
TamMDoan Nov 26, 2023
95d167e
moved interfaces to interfaces folder, added froilan and froilanda
Nov 26, 2023
2ac99e7
Merge pull request #17 from ZipcodeBraeburn/tam
TamMDoan Nov 26, 2023
d798a5c
sorry guys
Nov 26, 2023
31a1c90
Merge pull request #18 from ZipcodeBraeburn/tam
TamMDoan Nov 26, 2023
8da740b
eat
TevinGlover Nov 27, 2023
fba9dd7
Merge pull request #19 from ZipcodeBraeburn/Tevin
TevinGlover Nov 27, 2023
d29eeaf
working in test
Nov 26, 2023
ea5ab4c
working in test
Nov 27, 2023
ba767e8
Merge pull request #20 from ZipcodeBraeburn/christy
Christy-ED Nov 27, 2023
4657b63
working in test
Nov 27, 2023
4154dc4
Merge pull request #21 from ZipcodeBraeburn/christy
Christy-ED Nov 27, 2023
5c1cd7b
forland
TevinGlover Nov 27, 2023
9fcb28b
Merge pull request #22 from ZipcodeBraeburn/Tevin
TevinGlover Nov 27, 2023
db0692a
working in test
Nov 27, 2023
90078d5
Merge pull request #24 from ZipcodeBraeburn/christy
Christy-ED Nov 27, 2023
16ca8a5
fertilized, part of plant
Nov 27, 2023
0bc13f5
plant test+methods
Nov 27, 2023
049206f
refactoring code to use hasBeenFertilized variable
Nov 27, 2023
1a78b3a
Merge pull request #25 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
f9ab954
refactored crops, changed crop to abstract class
Nov 27, 2023
5e6f5a2
Merge pull request #26 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
93b9001
changed harvest
Nov 27, 2023
5b28e57
Merge pull request #27 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
3a9077b
Potato not tomato
TevinGlover Nov 27, 2023
b4e89db
Merge pull request #28 from ZipcodeBraeburn/Tevin
TevinGlover Nov 27, 2023
3250a53
added add test in Field
Nov 27, 2023
86bd023
setting up tests
Nov 27, 2023
bacdeec
Merge pull request #29 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
503abe2
finished setup for farm, wrote stuff for farm class
Nov 27, 2023
4890a23
Merge pull request #30 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
c6636f7
added methods to farm to add storages
Nov 27, 2023
e94f396
Merge pull request #32 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
8c11ede
set field in farm
Nov 27, 2023
8584bf9
Merge pull request #33 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
63eb1ff
sunday tests
Nov 27, 2023
c6924f6
Merge pull request #34 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
144787e
working in test
Nov 27, 2023
d6503c3
finish the Thurday test
Nov 27, 2023
20e0dc7
Merge pull request #35 from ZipcodeBraeburn/christy
Christy-ED Nov 27, 2023
81eb757
Friday and monday cropDuster
TevinGlover Nov 27, 2023
b98f9cd
Merge pull request #37 from ZipcodeBraeburn/Tevin
TevinGlover Nov 27, 2023
ce4adca
tues/sat tests
Nov 27, 2023
16db0b4
Merge pull request #38 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
5b7411f
op
TevinGlover Nov 27, 2023
76cd5ec
Merge pull request #39 from ZipcodeBraeburn/Tevin
TevinGlover Nov 27, 2023
ee49d0b
operator, cleaning up unused methods
Nov 27, 2023
69b1799
Merge pull request #40 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
3712377
finish the wednesday test
Nov 27, 2023
f159ba1
Merge pull request #41 from ZipcodeBraeburn/christy
Christy-ED Nov 27, 2023
783b5d2
chicken yield
Nov 27, 2023
863790e
Merge pull request #42 from ZipcodeBraeburn/tam
TamMDoan Nov 27, 2023
5488741
asdf
Nov 28, 2023
0a58163
Merge pull request #44 from ZipcodeBraeburn/tam
TamMDoan Nov 28, 2023
de6b20a
wrote notes
Nov 29, 2023
2dac393
Merge pull request #45 from ZipcodeBraeburn/tam
TamMDoan Nov 29, 2023
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
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
<groupId>com.zipcodewilmington</groupId>
<artifactId>froilans-farm</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.zipcodewilmington.froilansfarm.abstractClasses;

import com.zipcodewilmington.froilansfarm.interfaces.Pilot;
import com.zipcodewilmington.froilansfarm.interfaces.Vehicle;

public abstract class Aircraft implements Vehicle<Pilot> {

public boolean fly(){
System.out.println("Flying~~~");
return true;
}

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


import com.zipcodewilmington.froilansfarm.interfaces.EdibleCrops;
import com.zipcodewilmington.froilansfarm.interfaces.Produce;

public abstract class Crop<EdibleCropsType extends EdibleCrops> implements Produce<EdibleCropsType> {
public boolean hasBeenFertilized = false;
public boolean hasBeenHarvested = false;
public void setHasBeenFertilized(boolean hasBeenFertilized){
this.hasBeenFertilized = hasBeenFertilized;
}

public void setHasBeenHarvested(boolean hasBeenHarvested){
this.hasBeenHarvested = hasBeenHarvested;
}


/*
* So here in Crop, Crop is also a generic, because we'll want each class
* inheriting it to specify what kind of Edible it will Produce, etc, etc.
* We went through a similar process with Eater.
*
* Anyway! The cool thing about Crop is that its
* type parameter upper bound is NOT Edible.
* It's EdibleCrops!
* By doing this, we'll be able to eliminate EdibleEgg as a possible thing
* our Crops can yield -- because EdibleEgg will not be inheriting EdibleCrops.
* AND we can still pass the EdibleCropsType into Produce because
* EdibleCropsType is an Edible!
* We are just using EdibleCrops to limit ourselves to a certain subset
* of Edibles we can use for Crops.
*
* >>> CornStalk
*/

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

import com.zipcodewilmington.froilansfarm.interfaces.Edible;

import java.util.ArrayList;

public abstract class EdibleStorage<EdibleType extends Edible> extends ArrayList<EdibleType> {

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

import com.zipcodewilmington.froilansfarm.interfaces.Animal;

import java.util.ArrayList;

public abstract class Housing <AnimalType extends Animal> extends ArrayList<AnimalType> {

/*
* Housing is fun because you don't have to write anything in it
* and in the things that inherit it!!! :DDDDDDDD
*
* Housing is inheriting from ArrayList (extends ArrayList),
* so it inherits all of ArrayLists methods (add, remove, size, etc. etc.)
*
* The generics here are saying that Housing (and anything inheriting Housing)
* will hold (or be a list of, since it's inheriting from ArrayList)
* many certain somethings that is inheriting from Animal.
* That's this line here: Housing<AnimalType extends Animal>
* Since we want to be consistent, and since ArrayList itself is also a generic class,
* we put AnimalType as a type parameter for ArrayList (ArrayList<AnimalType>)
*
* We put this generic here because we want Housing to only ever handle things that
* are Animals!!!!
* By doing this, we make it so that it can't handle
* other things like Corn or Tractors or etc, etc, etc.
*
* Note: AnimalType here works like a method parameter name...
* ... except instead of name, it's data type
* So if you have any methods in here that uses/returns the animal,
* you would use AnimalType as the data type
*
* The method signature for the add method inherited from ArrayList would look like this:
* public boolean add(AnimalType animalToAdd);
*
*/

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

import com.zipcodewilmington.froilansfarm.interfaces.Animal;
import com.zipcodewilmington.froilansfarm.interfaces.Edible;
import com.zipcodewilmington.froilansfarm.interfaces.Rideable;
import com.zipcodewilmington.froilansfarm.interfaces.Rider;

public abstract class Person implements Animal<Edible> {
@Override
public String makeNoise() {
return "What a great Day";
}

@Override
public boolean eat(Edible edible, EdibleStorage edibleStorage) {
if (edibleStorage.contains(edible)) {
return edibleStorage.remove(edible);
}
System.out.println("We don't got this!");
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.zipcodewilmington.froilansfarm.classes;

import com.zipcodewilmington.froilansfarm.abstractClasses.Crop;

import java.util.ArrayList;

public class CropRow<CropType extends Crop> extends ArrayList<CropType > {


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

import com.zipcodewilmington.froilansfarm.classes.storage.*;

import java.util.ArrayList;

public class Farm {
ArrayList<Stable> stables;
ArrayList<ChickenCoop> coops;
FarmHouse farmHouse;
Field field;
TomatoStorage tomatoStorage;
PotatoStorage potatoStorage;
CornStorage cornStorage;
EggStorage eggStorage;

public Farm(FarmHouse farmHouse){
this.farmHouse = farmHouse;
this.stables = new ArrayList<>();
this.coops = new ArrayList<>();
}

public void addStables(Stable stable){
stables.add(stable);
}

public void addCoops(ChickenCoop coop){
coops.add(coop);
}

public ArrayList<Stable> getStables(){ return this.stables; }
public ArrayList<ChickenCoop> getCoops(){ return this.coops; }

public void setTomatoStorage(TomatoStorage tomatoStorage){
this.tomatoStorage = tomatoStorage;
}

public TomatoStorage getTomatoStorage(){
return this.tomatoStorage;
}

public void setPotatoStorage(PotatoStorage potatoStorage) {
this.potatoStorage = potatoStorage;
}

public PotatoStorage getPotatoStorage() {
return potatoStorage;
}

public void setCornStorage(CornStorage cornStorage) {
this.cornStorage = cornStorage;
}

public CornStorage getCornStorage() {
return cornStorage;
}

public void setEggStorage(EggStorage eggStorage) {
this.eggStorage = eggStorage;
}

public EggStorage getEggStorage() {
return eggStorage;
}

public Field getField(){
return this.field;
}
public void setField(Field field){
this.field = field;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package com.zipcodewilmington.froilansfarm.classes;

import com.zipcodewilmington.froilansfarm.classes.food.CornStalk;
import com.zipcodewilmington.froilansfarm.classes.food.PotatoPlant;
import com.zipcodewilmington.froilansfarm.classes.food.TomatoPlant;
import com.zipcodewilmington.froilansfarm.classes.rideables.Horse;
import com.zipcodewilmington.froilansfarm.classes.rideables.Tractor;
import com.zipcodewilmington.froilansfarm.interfaces.Botanist;
import com.zipcodewilmington.froilansfarm.abstractClasses.Person;
import com.zipcodewilmington.froilansfarm.interfaces.Rider;

public class Farmer extends Person implements Botanist, Rider<Tractor,Horse> {

@Override
public boolean mount(Tractor tractor) {
if(tractor.isIfMounted() == false){ // is false cause nobody is on the tractor
tractor.setIfMounted(true); // the tractor is mounted
return true;
}
return false;
}

@Override
public boolean dismount(Tractor tractor) {
if(tractor.isIfMounted() == true){ // is true cause somebody is on the tractor
tractor.setIfMounted(false);// the tractor is not mounted
return true;
}
return false;
}


// boolean ifMounted = false; started the horse with nobody on the horse
@Override
public boolean mount(Horse horse) {
if(horse.getIfMounted() == false){ // is false cause nobody is on the horse
horse.setIfMounted(true); // the horse is mounted
return true;
}
return false;
}

@Override
public boolean dismount(Horse horse) {
if(horse.getIfMounted() == true){ // is true cause somebody is on the horse
horse.setIfMounted(false);// the horse is not mounted
return true;
}
return false;
}

// I forgot to ask dolio about theseeeee
// ideally you would not want to write plant n times like this
// supposed to use generics to make a general plant method
// for all types of valid crops
// i.e. plant(Crop crop, CropRow<Crop> cropRow)... or something like this
// but it was giving us grief so we forced it like so below :D
@Override
public boolean plant(TomatoPlant crop, CropRow<TomatoPlant> cropRow) {
return cropRow.add(crop);
}

@Override
public boolean plant(PotatoPlant crop, CropRow<PotatoPlant> cropRow) {
return cropRow.add(crop);
}

@Override
public boolean plant(CornStalk crop, CropRow<CornStalk> cropRow) {
return cropRow.add(crop);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.zipcodewilmington.froilansfarm.classes;

import com.zipcodewilmington.froilansfarm.classes.food.CornStalk;
import com.zipcodewilmington.froilansfarm.classes.food.PotatoPlant;
import com.zipcodewilmington.froilansfarm.classes.food.TomatoPlant;

import java.util.ArrayList;

public class Field extends ArrayList<CropRow> {


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


public class Froilan extends Farmer {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.zipcodewilmington.froilansfarm.classes;
import com.zipcodewilmington.froilansfarm.abstractClasses.Person;
import com.zipcodewilmington.froilansfarm.classes.rideables.CropDuster;
import com.zipcodewilmington.froilansfarm.classes.rideables.Horse;
import com.zipcodewilmington.froilansfarm.interfaces.Pilot;

public class Froilanda extends Person implements Pilot {

boolean ifMounted = false; // no one mounted it

@Override
public boolean mount(CropDuster cropDuster) {
if(cropDuster.getIfMouted() == false){
cropDuster.setIfMouted(true);
return true;
}


return false;
}

@Override
public boolean dismount(CropDuster cropDuster) {
if(cropDuster.getIfMouted() == true) {
cropDuster.setIfMouted(false);
return true;

}
return false;
}

@Override
public boolean mount(Horse horse) {
if(horse.getIfMounted() == false){
horse.setIfMounted(true);
return true;
}
return false;
}

@Override
public boolean dismount(Horse horse) {
if(horse.getIfMounted() == true){
horse.setIfMounted(true);
return true;
}
return false;
}


}
Loading