Package tablero

Examples of tablero.Square


    else
      return false;
  }

  public boolean movePlayer(Player j, int casilla) {
    Square c = partida.getSquare(casilla);
    if (partida.playerMove(j, c))
      return true;
    else
      return false;
  }
View Full Code Here


  }

  public Set<Square> getReachableSquares(Player j) {
    Set<Square> validas = null; // validas a 1 casilla de distancia
    if (j != null) {
      Square casillaInicial = getPlayerLocation(j);
      Set<Square> validas2 = new TreeSet<Square>(); // validas a 2
                              // casillas de
                              // distancia
      validas = tablero.squaresConnectedTo(casillaInicial);
      for (Square square : validas) {
View Full Code Here

  public List<Square> getSquareList() {
    return tablero.getSquareList();
  }

  public Square getSquare(int squareNumber) {
    Square casilla = null;
    for (Square c : tablero.getSquareList()) {
      if (squareNumber == c.getNumCasilla())
        casilla = c;
    }
    return casilla;
View Full Code Here

    }
    return casilla;
  }

  public Square getSquare(String nombreCasilla) {
    Square casilla = null;
    for (Square c : tablero.getSquareList()) {
      if (nombreCasilla == c.getSquareName())
        casilla = c;
    }
    return casilla;
View Full Code Here

  public boolean playerMove(Player j, Square c) {
    if (j != null && c != null && tablero.isSquare(c)) {
      Set<Square> validas = getReachableSquares(j);
      if (validas.contains(c)) {
        Square antigua = j.getUbication();
        if (antigua != null)
          antigua.removePlayer(j);
        j.move(c);
        c.addPlayer(j);
        notificarUbicacionActualizada(j);
        if (c.getPlayerList().size() > 1)
          notifyTwoPlayersHere(j, c);
View Full Code Here

    }
  }

  // TODO: implementar esto mediante hash Map
  public void buildAbadiaMap() {
    tablero.addSquare(new Square(1, "Capilla"));
    tablero.addSquare(new Square(2, "Confesionario1"));
    tablero.addSquare(new Square(3, "Cripta"));
    tablero.addSquare(new Square(4, "Patio"));
    tablero.addSquare(new Square(5, "Confesionario2"));
    tablero.addSquare(new Square(6, "Claustro1"));
    tablero.addSquare(new Square(7, "Claustro2"));
    tablero.addSquare(new Square(8, "Claustro3"));
    tablero.addSquare(new Square(9, "Hall1"));
    tablero.addSquare(new Square(10, "Celda1"));
    tablero.addSquare(new Square(11, "Scriptorium"));
    tablero.addSquare(new Square(12, "Biblioteca"));
    tablero.addSquare(new Square(13, "Hall2"));
    tablero.addSquare(new Square(14, "Celda2"));
    tablero.addSquare(new Square(15, "Claustro4"));
    tablero.addSquare(new Square(16, "Hall3"));
    tablero.addSquare(new Square(17, "Celda3"));
    tablero.addSquare(new Square(18, "Sala capitular"));
    tablero.addSquare(new Square(19, "Hall4"));
    tablero.addSquare(new Square(20, "Celda4"));
    tablero.addSquare(new Square(21, "Hall5"));
    tablero.addSquare(new Square(22, "Celda5"));
    tablero.addSquare(new Square(23, "Locutorio"));
    tablero.addSquare(new Square(24, "Hall6"));
    tablero.addSquare(new Square(25, "Celda6"));
    tablero.connectSquare(getSquare(1), getSquare(2));
    tablero.connectSquare(getSquare(1), getSquare(3));
    tablero.connectSquare(getSquare(1), getSquare(4));
    tablero.connectSquare(getSquare(4), getSquare(5));
    tablero.connectSquare(getSquare(4), getSquare(6));
View Full Code Here

TOP

Related Classes of tablero.Square

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.