Exemplo n.º 1
0
  public List<Command> getLegalCommands(Piece p) {
    LinkedList<Command> commands = new LinkedList<Command>();

    for (Command c : p.getCommands()) {
      if (c.getCost() <= movesLeft) commands.add(c);
    }

    return commands;
  }
Exemplo n.º 2
0
  public List<Command> getLegalCommands() {

    LinkedList<Command> commands = new LinkedList<Command>();

    for (Piece p : board.getPieces(faction)) {
      for (Command c : p.getCommands()) {
        if (c.getCost() <= movesLeft) commands.add(c);
      }
    }

    return commands;
  }