Examples of TaulerHex


Examples of prop.hex.domini.models.TaulerHex

   *
   * @return La casella més propera al centre on es pot moure.
   */
  protected Casella posicioCentral()
  {
    TaulerHex tauler = partida.getTauler();

    for ( int fila = 0; fila < tauler.getMida() / 2; fila++ )
    {
      for ( int columna = 0; columna < tauler.getMida() / 2; columna++ )
      {
        if ( tauler.esMovimentValid( EstatCasella.JUGADOR_A, tauler.getMida() / 2 + fila,
            tauler.getMida() / 2 + columna ) )
        {
          return new Casella( tauler.getMida() / 2 + fila, tauler.getMida() / 2 + columna );
        }
        if ( tauler.esMovimentValid( EstatCasella.JUGADOR_A, tauler.getMida() / 2 - fila,
            tauler.getMida() / 2 - columna ) )
        {
          return new Casella( tauler.getMida() / 2 - fila, tauler.getMida() / 2 - fila );
        }
      }
    }

    //si el tauler no esta ple no hauriem d'arribar mai aqui.
View Full Code Here

Examples of prop.hex.domini.models.TaulerHex

   */
  public static void testInstanciaTauler()
  {
    int mida = llegeixEnter( "Introdueix la mida del tauler (més gran que 0):" );

    taulers.add( new TaulerHex( mida ) );
    actual = taulers.size() - 1;
    System.out.println( "[OK]\tS'ha instanciat el tauler amb èxit.\n\tEl tauler actual és: " + actual + ".\n\tLes" +
                        " seves característiques són:\n" + taulers.get( actual ).toString() );
  }
View Full Code Here

Examples of prop.hex.domini.models.TaulerHex

      System.out.println( taulers.size() );
      int num = llegeixEnter(
          "Escriu el número del tauler per copiar (entre 0 i " + Integer.toString( taulers.size() - 1 ) +
          "):" );

      taulers.add( new TaulerHex( taulers.get( num ) ) );
      actual = taulers.size() - 1;
      System.out.println( "[OK]\tS'ha copiat el tauler amb èxit.\n\tEl tauler actual és: " + actual + ".\n\tLes" +
                          " seves característiques són:\n" + taulers.get( actual ).toString() );
    }
    else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.