-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86d7886
commit 27789cd
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
01-lecture/quemepongo/src/main/java/quemepongo/Recomendador.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package quemepongo; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Random; | ||
|
||
/** | ||
* Recomendador de uniformes | ||
* | ||
* @since 04.28.2021 | ||
* @version 1.0 | ||
*/ | ||
public class Recomendador { | ||
|
||
/** | ||
* Listado de modistas actuales. | ||
* | ||
* @since 1.0 | ||
*/ | ||
private List<Modista> modistas; | ||
|
||
/** | ||
* Instancia un recomendador con los modistas Jhonson y San Juan | ||
*/ | ||
public Recomendador() { | ||
modistas = new ArrayList<Modista>(); | ||
modistas.add(new ModistaJhonson()); | ||
modistas.add(new ModistaSanJuan()); | ||
} | ||
|
||
/** | ||
* Recomienda un uniforme a un usuario. | ||
* | ||
* @return un Uniforme de alguno de los modistas | ||
*/ | ||
public Uniforme recomendarUniforme() { | ||
return modistas.get(new Random().nextInt(modistas.size())).fabricarUniforme(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters