-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoardStyle2.java
More file actions
39 lines (37 loc) · 1.11 KB
/
Copy pathBoardStyle2.java
File metadata and controls
39 lines (37 loc) · 1.11 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
import java.awt.*;
import java.awt.geom.Rectangle2D;
/**
* The class the implements a style of the board.
* @author: Hung Phan
* @author: Lien Cao
* @author: Wendy Ta
* @version: 1.0 11/28/25
*/
public class BoardStyle2 implements BoardStyle {
/**
* Draws the pits in light brown color.
* @param g2: the Graphics component used to draw the the pit
* @param pit: the pit to draw
*/
@Override
public void drawPit(Graphics2D g2, Pit pit) {
g2.setColor(Color.decode("#ad6e45"));
g2.fill(pit.getPit());
g2.setColor(Color.BLACK);
g2.setStroke(new BasicStroke(3));
g2.draw(pit.getPit());
}
/**
* Draws the outline of the board in dark brown color.
* @param g2: the Graphics component used to draw the the pit
* @param board: the rectangular graphic representing the board
*/
@Override
public void drawBoard(Graphics2D g2, Rectangle2D board) {
g2.setColor(Color.black);
g2.setStroke(new BasicStroke(5));
g2.draw(board);
g2.setColor(Color.decode("#36251a"));
g2.fill(board);
}
}