add parts

This commit is contained in:
Minh VU
2024-11-20 07:03:18 +01:00
parent 9188d50741
commit cc920bf6b6
7 changed files with 38 additions and 4 deletions

View File

@@ -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)){

View File

@@ -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;

View File

@@ -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 ) {

View File

@@ -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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}