-
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
441ac79
commit 57778d6
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
01-lecutre/quemepongo/src/main/java/quemepongo/Material.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,12 @@ | ||
package quemepongo; | ||
|
||
/** | ||
* Dominio de Materiales | ||
* | ||
* @author Tomás Sánchez | ||
* @version 1.0 | ||
* @since 04.21.2021 | ||
*/ | ||
public enum Material { | ||
ALGODON, JEAN, LANA, LINO | ||
} |
81 changes: 81 additions & 0 deletions
81
01-lecutre/quemepongo/src/main/java/quemepongo/Prenda.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,81 @@ | ||
package quemepongo; | ||
|
||
/** | ||
* Prendas de QuéMePongo | ||
* | ||
* @author Tomás Sánchez | ||
* @since 04.21.2021 | ||
* @version 1.0 | ||
*/ | ||
public class Prenda { | ||
|
||
/** | ||
* El tipo de prenda | ||
* | ||
* @since 1.0 | ||
*/ | ||
public final Tipo tipo; | ||
|
||
/** | ||
* El color primario | ||
* | ||
* @since 1.0 | ||
*/ | ||
public final Color color1; | ||
|
||
/** | ||
* El color secundario | ||
* | ||
* @since 1.0 | ||
*/ | ||
public Color color2 = Color.NINGUNO; | ||
|
||
/** | ||
* El material con que está hecho la prenda | ||
* | ||
* @since 1.0 | ||
*/ | ||
public final Material material; | ||
|
||
/** | ||
* La categoría de la prenda, coincidente con la de su tipo. | ||
* | ||
* @since 1.0 | ||
*/ | ||
public Categoria categoria() { | ||
return tipo.categoria(); | ||
} | ||
|
||
/** | ||
* Instancia una prenda de un único color. | ||
* | ||
* @param tipoPrenda - el tipo de la prendas | ||
* @param principal - el color principal | ||
* @param matnr - el material con el que está hecha | ||
* @author Tomás Sánchez | ||
* @since 1.0 | ||
*/ | ||
public Prenda(Tipo tipoPrenda, Color principal, Material matnr) { | ||
tipo = tipoPrenda; | ||
color1 = principal; | ||
material = matnr; | ||
} | ||
|
||
/** | ||
* Instancia una prenda con dos colores | ||
* | ||
* @param tipoPrenda - el tipo de la prendas | ||
* @param principal - el color principal | ||
* @param secundario - el color secundario | ||
* @param matnr - el material con el que está hecha | ||
* @author Tomás Sánchez | ||
* @since 1.0 | ||
*/ | ||
public Prenda(Tipo tipoPrenda, Color principal, Color secundario, Material matnr) { | ||
tipo = tipoPrenda; | ||
color1 = principal; | ||
color2 = secundario; | ||
material = matnr; | ||
} | ||
|
||
} |