add parts
This commit is contained in:
@@ -66,7 +66,6 @@ public class ConfigurationImpl implements Configuration {
|
||||
@Override
|
||||
public void selectPart(PartType chosenPart) {
|
||||
Category cat_chosenPart = chosenPart.getCategory();
|
||||
|
||||
//Vérifier s'il y a des pièces dans la même catégorie, si oui return
|
||||
for(Part pt: selectedParts){
|
||||
if(pt.getCategory().equals(cat_chosenPart)){
|
||||
|
||||
@@ -17,6 +17,10 @@ public class PartImpl implements Part {
|
||||
|
||||
private PartType type;
|
||||
|
||||
public PartImpl(PartType type){
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
private class Property {
|
||||
public final Supplier<String> getter;
|
||||
public final Consumer<String> setter;
|
||||
|
||||
@@ -10,8 +10,6 @@ import src.fr.api.PartType;
|
||||
public class PartTypeImpl implements PartType {
|
||||
private String name;
|
||||
private Category category;
|
||||
|
||||
//V2 implement
|
||||
private Class<? extends PartImpl> classRef;
|
||||
|
||||
public PartTypeImpl(String name,Class<? extends PartImpl> classref, Category category ) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package src.fr.impl.Parts;
|
||||
|
||||
import src.fr.api.PartType;
|
||||
import src.fr.impl.PartImpl;
|
||||
|
||||
public class Engine extends PartImpl {
|
||||
|
||||
public Engine(PartType partType){
|
||||
super(partType);
|
||||
}
|
||||
}
|
||||
|
||||
10
src/fr/impl/Parts/Exterior.java
Normal file
10
src/fr/impl/Parts/Exterior.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package src.fr.impl.Parts;
|
||||
|
||||
import src.fr.api.PartType;
|
||||
import src.fr.impl.PartImpl;
|
||||
|
||||
public class Exterior extends PartImpl {
|
||||
public Exterior(PartType partType){
|
||||
super(partType);
|
||||
}
|
||||
}
|
||||
10
src/fr/impl/Parts/Interior.java
Normal file
10
src/fr/impl/Parts/Interior.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package src.fr.impl.Parts;
|
||||
|
||||
import src.fr.api.PartType;
|
||||
import src.fr.impl.PartImpl;
|
||||
|
||||
public class Interior extends PartImpl {
|
||||
public Interior(PartType partType){
|
||||
super(partType);
|
||||
}
|
||||
}
|
||||
10
src/fr/impl/Parts/Transmission.java
Normal file
10
src/fr/impl/Parts/Transmission.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package src.fr.impl.Parts;
|
||||
|
||||
import src.fr.api.PartType;
|
||||
import src.fr.impl.PartImpl;
|
||||
|
||||
public class Transmission extends PartImpl {
|
||||
public Transmission(PartType partType){
|
||||
super(partType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user