Skip to content
Permalink
Browse files
Hide The Board's Implementation
  • Loading branch information
ClayDowling committed Apr 15, 2017
1 parent 535b901 commit 4d189dcc1f9d96214a90bef1e3e6ce966e0ff3cc
Showing 2 changed files with 6 additions and 3 deletions.
@@ -26,4 +26,8 @@ The engine tests have been converted. Notice that they still take advantage of

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

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.
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.

## Hide The Board's Implementation

I can now hide the implementation of the board and all tests still pass. This opens the way to change the actual implementation.
@@ -4,8 +4,7 @@
public class LifeBoard implements Board {
public static final int X_MAX = 50;
public static final int Y_MAX = 50;
public boolean[][] value = new boolean[X_MAX][Y_MAX];

private boolean[][] value = new boolean[X_MAX][Y_MAX];

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

0 comments on commit 4d189dc

Please sign in to comment.