@Test public void testValid() { assertTrue( board.valid(L4, 0, 1)); board.add(L4, 0, 1); assertFalse( board.valid(L4, 1, 3)); assertFalse( board.valid(L4, 1, 4)); assertFalse( board.valid(L4, 2, 3)); assertTrue( board.valid(L4, 2, 4)); board.add(L4, 2, 4); }
public boolean valid( Move move) { return valid( move.piece, move.i, move.j); }
Game { public boolean valid( Move move) { return valid( move.piece, move.i, move.j); } }
Game { public boolean valid( Move move) { return valid( move.piece, move.i, move.j); } Game(); }
Game { public boolean valid( Move move) { return valid( move.piece, move.i, move.j); } Game(); void reset(); void historize(Move move); boolean over(); int winner(); boolean replay(List<Move> moves); boolean valid( Move move); boolean valid( Piece piece, int i, int j); boolean fits( Piece p, int i, int j); boolean play(Move move); String toString(); List<Move> deserialize(String msg); int scoreEnemySeedsIfAdding(int color, Piece piece, int i, int j); }
Game { public boolean valid( Move move) { return valid( move.piece, move.i, move.j); } Game(); void reset(); void historize(Move move); boolean over(); int winner(); boolean replay(List<Move> moves); boolean valid( Move move); boolean valid( Piece piece, int i, int j); boolean fits( Piece p, int i, int j); boolean play(Move move); String toString(); List<Move> deserialize(String msg); int scoreEnemySeedsIfAdding(int color, Piece piece, int i, int j); static final String tag; public List<Board> boards; public int size; public int[] colors; public List<Move> moves; }