コード例 #1
0
 @Override
 public GobanModel getNextState() {
   GobanModel gobanModel;
   gobanModel = new GobanModel(gameStates.get(gameStates.size() - 1));
   Move move = getNextMove();
   if (move != null) {
     gobanModel.putStone(move);
     gameStates.add(gobanModel);
     return gameStates.get(gameStates.size() - 1);
   }
   return null;
 }
コード例 #2
0
  @Override
  public void putMove(Move move) {
    Node newNode;
    GobanModel gobanModel = gameStates.get(gameStates.size() - 1);

    if (gobanModel.isEmpty(move)) {
      if (null != actual) {
        newNode = new Node(actual, move);
        actual.addChild(newNode);
      } else {
        newNode = new Node(null, move);
        root = newNode;
      }
      gobanModel.putStone(move);
      gameStates.add(gobanModel);
      actual = newNode;
      moveNo++;
    }
  }