getprixtotal pour config
This commit is contained in:
@@ -201,6 +201,4 @@ public class CompatibilityManagerImpl implements CompatibilityManager {
|
|||||||
Femeture_Transivite(reference, result,new HashSet<>(),reference);
|
Femeture_Transivite(reference, result,new HashSet<>(),reference);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,6 @@ public class ConfigurationImpl implements Configuration {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
if (this.isComplete()){
|
|
||||||
for(Part pt: selectedParts){
|
for(Part pt: selectedParts){
|
||||||
//Verifier Requirements
|
//Verifier Requirements
|
||||||
for(PartType require : compatibilityManager.getRequirements(pt.getType())){
|
for(PartType require : compatibilityManager.getRequirements(pt.getType())){
|
||||||
@@ -44,11 +43,23 @@ public class ConfigurationImpl implements Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPriceTotal(){
|
||||||
|
int prix_final=0;
|
||||||
|
if(this.isValid()){
|
||||||
|
for(Part pt: selectedParts){
|
||||||
|
Optional<String> price_opt =pt.getProperty("prix");
|
||||||
|
if(price_opt.isPresent()){
|
||||||
|
int prix_piece= Integer.parseInt(price_opt.get());
|
||||||
|
prix_final += prix_piece;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return prix_final;
|
||||||
|
}else{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isComplete() {
|
public boolean isComplete() {
|
||||||
|
|||||||
Reference in New Issue
Block a user