Hope it works manager
like title
This commit is contained in:
@@ -9,16 +9,24 @@ import java.util.Set;
|
||||
public class Configuration implements fr.istic.nplouzeau.cartaylor.api.Configuration {
|
||||
private Set<PartType> selectedParts;
|
||||
private CompatibilityManager compatibilityManager;
|
||||
private static int NB_CATEGORY = 4;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
if ( this.isComplete()){
|
||||
|
||||
return true;
|
||||
|
||||
if (this.isComplete()){
|
||||
for(PartType pt: selectedParts){
|
||||
//Verifier Requirements
|
||||
for(PartType require : compatibilityManager.getRequirements(pt)){
|
||||
if(!selectedParts.contains(pt)) return false;
|
||||
}
|
||||
//Verifier Incompabilities
|
||||
for(PartType incompa : compatibilityManager.getIncompatibilities(pt)){
|
||||
if(selectedParts.contains(pt)) return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -26,7 +34,7 @@ public class Configuration implements fr.istic.nplouzeau.cartaylor.api.Configura
|
||||
|
||||
@Override
|
||||
public boolean isComplete() {
|
||||
if(selectedParts.size()==4){
|
||||
if(selectedParts.size()==NB_CATEGORY){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user