Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

Coverage #42

Merged
merged 3 commits into from
Oct 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ generateGrammarSource {

cobertura {
coverageFormats = ['html', 'xml']
coverageExcludes = ['.*instrumented_classes.ui.*']
coverageExcludes = ['.*instrumented_classes.ui.*', '.*instrumented_classes.event.*DrawerEventWrapper*']
coverageIgnoreTrivial = true
}

Expand Down
70 changes: 0 additions & 70 deletions src/main/java/logic/gametree/ComplexTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,10 @@
package logic.gametree;

import logic.board.Board;
import util.Coords;
import util.Move;
import util.StoneColour;

import java.util.List;

import static util.Coords.fromSGFString;
import static util.Move.pass;
import static util.Move.play;
import static util.StoneColour.fromString;

public class ComplexTree implements GameTree {

private TreeNode root;
Expand All @@ -43,10 +36,6 @@ private ComplexTree(TreeNode rootNode) {
current = new ComplexTreeIterator(root);
}

public static GameTreeBuilder getBuilder() {
return new Builder();
}

@Override
public boolean isRoot() {
return current.isRoot();
Expand Down Expand Up @@ -105,63 +94,4 @@ public Board getPosition() {
public Board getLastPosition() {
return current.getLastPosition();
}

private static class Builder implements GameTreeBuilder {

private TreeNode root;
private TreeNode current;

private Builder() {
root = new TreeNode();
current = root;
}

@Override
public GameTree build() {
GameTree result = new ComplexTree(root);

while (result.getNumChildren() > 0)
result.stepForward(0);

return result;
}

@Override
public void gotoRoot() {
current = root;
}

@Override
public TreeNode getRoot() {
return root;
}

@Override
public void addVariation(GameTreeBuilder subtree) {
current.addChild(subtree.getRoot());
}

@Override
public void appendNode() {
TreeNode node = new TreeNode();
current.addChild(node);
current = node;
}

@Override
public void appendProperty(GameTreeProperty property) {
String identifier = property.getIdentifier();
if ( identifier.equals("B") || identifier.equals("W") ) {
StoneColour colour = fromString(identifier);

if ( property.getValues().isEmpty() )
current.setMove(pass(colour));
else {
Coords coords = fromSGFString(property.getValues().firstElement());

current.setMove(play(coords, colour));
}
}
}
}
}
103 changes: 0 additions & 103 deletions src/main/java/logic/gametree/SimpleGameTree.java

This file was deleted.

103 changes: 0 additions & 103 deletions src/main/java/logic/gametree/TreeNodeOld.java

This file was deleted.

Loading