Commit d43b03f9 authored by Grand Francois's avatar Grand Francois
Browse files

#28 StructureProperties.findCompatibleLoiDebit() : ajout d'un argument pour...

 #28 StructureProperties.findCompatibleLoiDebit() : ajout d'un argument pour limiter les résultats possibles
parent 222bb0ea
No related merge requests found
Showing with 13 additions and 3 deletions
+13 -3
...@@ -77,10 +77,20 @@ export class StructureProperties { ...@@ -77,10 +77,20 @@ export class StructureProperties {
} }
/** /**
* @return la 1ère valeur de LoiDebit compatible avec le type de structure * trouve la 1ère valeur de LoiDebit compatible avec le type de structure
* @param struct type de structure avec laquelle la loi de débit doit être compatible
* @param subset si non vide, recherche la loi de débit compatible dans ce tableau; sinon prend la 1ere
*/ */
public static findCompatibleLoiDebit(struct: StructureType): LoiDebit { public static findCompatibleLoiDebit(struct: StructureType, subset: LoiDebit[]): LoiDebit {
const sst: string = StructureType[struct]; const sst: string = StructureType[struct];
return loiAdmissibles[sst][0];
if (subset.length === 0)
return loiAdmissibles[sst][0];
for (const ld of loiAdmissibles[sst])
if (subset.includes(ld))
return ld;
return undefined;
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment