Package org.knapper.tubes.core.model

Examples of org.knapper.tubes.core.model.ICell


   
    return connected;
  }
 
  public static ICell getConnectedTopCell(IBoard board, ICell refrenceCell) {   
    ICell topCell = getTopCell(board, refrenceCell);
   
    if (topCell != null) {
      if (topCell.getCard() != null && connected(
          topCell.getCard().getBottomConnection(),
          refrenceCell.getCard().getTopConnection())) {
       
        return topCell;
      }
    }
View Full Code Here


   
    return null;
  }
 
  public static ICell getConnectedRightCell(IBoard board, ICell refrenceCell) {   
    ICell rightCell = getRightCell(board, refrenceCell);
   
    if (rightCell != null) {
      if (rightCell.getCard() != null && connected(
          rightCell.getCard().getLeftConnection(),
          refrenceCell.getCard().getRightConnection())) {
       
        return rightCell;
      }
    }
View Full Code Here

   
    return null;
  }
 
  public static ICell getConnectedBottomCell(IBoard board, ICell refrenceCell) {   
    ICell bottomCell = getBottomCell(board, refrenceCell);
   
    if (bottomCell != null) {
      if (bottomCell.getCard() != null && connected(
          bottomCell.getCard().getTopConnection(),
          refrenceCell.getCard().getBottomConnection())) {
       
        return bottomCell;
      }
    }
View Full Code Here

   
    return null;
  }
 
  public static ICell getConnectedLeftCell(IBoard board, ICell refrenceCell) {   
    ICell leftCell = getLeftCell(board, refrenceCell);
   
    if (leftCell != null) {
      if (leftCell.getCard() != null && connected(
          leftCell.getCard().getRightConnection(),
          refrenceCell.getCard().getLeftConnection())) {
       
        return leftCell;
      }
    }
View Full Code Here

  }
 
  public static ICell[] getConnectedCells(IBoard board, ICell refrenceCell) {
    ArrayList<ICell> connectedCells = new ArrayList<ICell>();
   
    ICell topCell = getConnectedTopCell(board, refrenceCell);
    if (topCell != null) {
      connectedCells.add(topCell);
    }
   
    ICell rightCell = getConnectedRightCell(board, refrenceCell);
    if (rightCell != null) {
      connectedCells.add(rightCell);
    }
   
    ICell bottomCell = getConnectedBottomCell(board, refrenceCell);
    if (bottomCell != null) {
      connectedCells.add(bottomCell);
    }
   
    ICell leftCell = getConnectedLeftCell(board, refrenceCell);
    if (leftCell != null) {
      connectedCells.add(leftCell);
    }
   
    return connectedCells.toArray(new ICell[0]);
View Full Code Here

  public ICell getStartCell() {
    return cells[startColumn][startRow];
  }

  public int getLongestPathLength() {
    ICell startCell = getStartCell();
   
    return getLongestPathLength(new ArrayList<ICell>(), startCell);
  }
View Full Code Here

TOP

Related Classes of org.knapper.tubes.core.model.ICell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.