-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathValor.java
More file actions
32 lines (28 loc) · 769 Bytes
/
Valor.java
File metadata and controls
32 lines (28 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
public enum Valor {
AS("Ás"), _2("2"), _3("3"), _4("4"), _5("5"), _6("6"), _7("7"), _8("8"), _9("9"), _10("10"),
VALETE("Valete"), DAMA("Dama"), REI("Rei");
private String valor;
private Valor(String valor){
this.valor = valor;
}
@Override
public String toString(){
return this.valor;
}
public int getValor(){
if(valor=="Ás") return 1;
if(valor=="2") return 2;
if(valor=="3") return 3;
if(valor=="4") return 4;
if(valor=="5") return 5;
if(valor=="6") return 6;
if(valor=="7") return 7;
if(valor=="8") return 8;
if(valor=="9") return 9;
if(valor=="10") return 10;
if(valor=="Valete") return 10;
if(valor=="Dama") return 10;
if(valor=="Rei") return 10;
return 0;
}
}