-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEjercitoAzul.java
More file actions
36 lines (27 loc) · 843 Bytes
/
Copy pathEjercitoAzul.java
File metadata and controls
36 lines (27 loc) · 843 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
33
34
35
36
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package risk;
import java.util.ArrayList;
/**
*
* @author landr
*/
public class EjercitoAzul extends EjercitoBase {
public EjercitoAzul() {
super();
}
//Si el ejército atacante es azul/verde, se suma una unidad al dado de mayor valor
@Override
ArrayList<Integer> ataque(ArrayList<Integer> dadoAtaque) {
//Si se tira más de un dado
if (dadoAtaque.size() > 1) {
int i = dadoAtaque.get(maximoDado(dadoAtaque)).intValue() + 1;
Integer suma = new Integer(i);
dadoAtaque.set(maximoDado(dadoAtaque), suma);
}
return dadoAtaque;
}
}