Skip to content

Commit 4d189dc

Browse files
committed
Hide The Board's Implementation
1 parent 535b901 commit 4d189dc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ The engine tests have been converted. Notice that they still take advantage of
2626

2727
Engine is the last class which was using the internal representation of the LifeBoard. Now it's converted to use only the defined interfaces.
2828

29-
By passing the LifeBoard to the constructor of the engine, I'm also removing the dependency on the static implementation of the board's storage. I verified that by removing the static storage class in LifeBoard.
29+
By passing the LifeBoard to the constructor of the engine, I'm also removing the dependency on the static implementation of the board's storage. I verified that by removing the static storage class in LifeBoard.
30+
31+
## Hide The Board's Implementation
32+
33+
I can now hide the implementation of the board and all tests still pass. This opens the way to change the actual implementation.

src/main/java/LifeBoard.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
public class LifeBoard implements Board {
55
public static final int X_MAX = 50;
66
public static final int Y_MAX = 50;
7-
public boolean[][] value = new boolean[X_MAX][Y_MAX];
8-
7+
private boolean[][] value = new boolean[X_MAX][Y_MAX];
98

109
public void clear() {
1110
for(int x=0; x < X_MAX; ++x) {

0 commit comments

Comments
 (0)