-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wild.java
57 lines (49 loc) · 1.23 KB
/
Wild.java
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
public class Wild extends ActionCard
{
/**
* calls constructor of action card with current game
*
* @param currGame
* current game present
*/
public Wild( Game currGame )
{
super( currGame );
}
/**
* calls constructor of action card with current game and specific color
*
* @param color
* specific color of week
* @param currGame
* current game present
*/
public Wild( String color, Game currGame )
{
super( color, currGame );
}
/**
* action of the wild card
*
* @param idNum
* current player index
* @param color
* color to be changed to
*/
public void doAction( int idNum, String color )
{
getCurrGame().setColor( color );
getCurrGame().getServer().broadcast( "c" + color );
getCurrGame().getServer().broadcast( idNum + "pwild" );
}
/**
* defining the abstract method of action card
*
* @param idNum
* current player index
*/
public void doAction( int idNum )
{
doAction( idNum, "red" );
}
}