ajustement des prix

This commit is contained in:
trochas
2024-12-04 17:46:11 +01:00
parent f9c6059067
commit 503d24f140
2 changed files with 37 additions and 7 deletions

View File

@@ -1,11 +1,41 @@
package src.fr.impl.Parts;
import java.util.HashSet;
import java.util.Set;
import src.fr.impl.CategoryImpl;
import src.fr.impl.PartImpl;
import src.fr.impl.PartTypeImpl;
public class Interior extends PartImpl {
public class Interior extends PartImpl {
private static final Set<String> colorSet;
static {
colorSet = new HashSet<>();
colorSet.add("black");
colorSet.add("white");
colorSet.add("cream");
}
String color;
String material;
public Interior(String name, CategoryImpl category, int price){
super(new PartTypeImpl(name,Engine.class, category), price);
}
public String getColor(){
return this.color;
}
public void setColor(String newColor){
this.color = newColor;
}
}

View File

@@ -24,12 +24,12 @@ public class test {
PartType EG100PartType = new PartTypeImpl("EG100",Engine.class,engine);
Engine EG100 = new Engine("EG100",engine,3000);
Engine EG133 = new Engine("EG133",engine,8000);
Engine EG210= new Engine("EG210", engine,15000);
Engine ED110= new Engine("ED110", engine,2000);
Engine ED180= new Engine("ED180", engine,4000);
Engine EH120= new Engine("EH120", engine,15000);
Engine EG100 = new Engine("EG100",engine,19000);
Engine EG133 = new Engine("EG133",engine,2200);
Engine EG210= new Engine("EG210", engine,25000);
Engine ED110= new Engine("ED110", engine,18000);
Engine ED180= new Engine("ED180", engine,20000);
Engine EH120= new Engine("EH120", engine,30000);
Transmission TM5= new Transmission("TM5", transmission,2000);
Transmission TM6= new Transmission("TM6", transmission,4000);