-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConstants.java
More file actions
80 lines (76 loc) · 2.31 KB
/
Copy pathConstants.java
File metadata and controls
80 lines (76 loc) · 2.31 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* Contains all the constants needed among all classes.
*/
public class Constants {
/**
* These definitions are used in the contents of squares in CBoard.
* the CELL_WHITE and CELL_RED definitions are also used to refer
* to this and the other player.
*
* Note that 1<<0 refers to the first bit of an integer being set, 1<<1 the
* second, and so on.
*/
public static final int CELL_EMPTY = 0; // The cell is empty
public static final int CELL_RED = 1<<0; // The cell belongs to the red player
public static final int CELL_WHITE = 1<<1; // The cell belongs to the white player
public static final int CELL_KING = 1<<2; // The cell is a king
public static final int CELL_INVALID = 1<<3; // The cell is invalid
/**
* A simple way of representing the pieces of the board.
*/
public static final String[] SIMPLE_TEXT = {
". ", // CELL_EMPTY
"r ", // CELL_RED
"w ", // CELL_WHITE
"? ", // Unused
"? ", // Unused
"R ", // CELL_RED | CELL_KING
"W ", // CELL_WHITE | CELL_KING
"? ", // Unused
" ", // CELL_INVALID
};
/**
* A more sophisticated way of representing the pieces of the board, using
* the Unicode character set.
*/
public static final String[] UNICODE_TEXT = {
". ", // CELL_EMPTY
"⛂ ", // CELL_RED
"⛀ ", // CELL_WHITE
"? ", // Unused
"? ", // Unused
"⛃ ", // CELL_RED | CELL_KING
"⛁ ", // CELL_WHITE | CELL_KING
"? ", // Unused
" ", // CELL_INVALID
};
/**
* A quite sophisticated way of representing the pieces of the board, using
* the Unicode character set with colors.
*/
public static final String[] COLOR_TEXT = {
". ", // CELL_EMPTY
"\u001B[31m⛂ \u001B[0m", // CELL_RED
"⛀ ", // CELL_WHITE
"? ", // Unused
"? ", // Unused
"\u001B[31m⛃ \u001B[0m", // CELL_RED | CELL_KING
"⛁ ", // CELL_WHITE | CELL_KING
"? ", // Unused
" ", // CELL_INVALID
};
/**
* Symbols used for messages between clients.
*/
public static final char[] MESSAGE_SYMBOLS = {
'.', // CELL_EMPTY
'r', // CELL_RED
'w', // CELL_WHITE
'?', // Unused
'?', // Unused
'R', // CELL_RED | CELL_KING
'W', // CELL_WHITE | CELL_KING
'?', // Unused
'_', // CELL_INVALID
};
}