Package pdp.scrabble.game.impl

Examples of pdp.scrabble.game.impl.LocationImpl


  model.update(board);
  allowedLetters[Direction.ACROSS.ordinal()].compute(Direction.DOWN);
  allowedLetters[Direction.DOWN.ordinal()].compute(Direction.ACROSS);

  if (model.isFree(Board.HORI_DIM/2, Board.VERT_DIM/2)) { // cas du premier coup : le centre est vide et doit etre couvert par le coup
      Location start = new LocationImpl(Board.HORI_DIM/2, Board.VERT_DIM/2);
      generateForSquare(Direction.ACROSS, start, model, letters);
      generateForSquare(Direction.DOWN, start, model, letters);
  }
  else {
      generate(Direction.ACROSS,letters);
View Full Code Here


  for (int i=0 ; i<Board.VERT_DIM ; i++)
      generateForRow(dir, i, model, letters);
    }

    private void generateForRow(Direction dir, int row, AIBoardModel board, Rack letters) {
  Location square = (dir.equals(Direction.ACROSS) ? new LocationImpl(row, 0) : new LocationImpl(0, row));
  while (board.contains(square)) {
      if(board.isAnchorSquare(square.getV(), square.getH()))
    generateForSquare(dir, square, board, letters);
      dir.applyTo(square);
  }
View Full Code Here

    AIBoardModel aiBoard = new AIBoardModel(board);
    for(int x =0; x<Board.HORI_DIM; x++)
      for(int y= 0; y<Board.VERT_DIM;y++)
        if(aiBoard.isAnchorSquare(x,y)){
          int posRelative = 0;
          Location posAbs = new LocationImpl(y,x);
          generate_aux(aiBoard,posRelative,posAbs,"",letters, gaddag.getTop());
        }
  }
View Full Code Here

//    }
   
    public void compute(Direction dir) {
  for (int i=0 ; i<Board.VERT_DIM ; i++)
      for (int j=0 ; j<Board.HORI_DIM ; j++) {
    computeCrossCheckForSquare(new LocationImpl(i, j), dir);
      }
    }
View Full Code Here

    private Direction dir;
    private String leave;

    public ClassicMoveModel(String word, Location first, Direction dir, String leave) {
  this.word = word;
  this.first = new LocationImpl(first.getV(), first.getH());
  this.dir = dir;
  this.leave = leave;
    }
View Full Code Here

TOP

Related Classes of pdp.scrabble.game.impl.LocationImpl

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.