Package net.sourceforge.java_stratego.stratego

Examples of net.sourceforge.java_stratego.stratego.Move


   
  }
 
  public boolean validMove(Spot f, Spot t)
  {
    if (super.validAttack(new Move(getPiece(f), f, t)))
      return true;
   
    return super.validMove(new Move(getPiece(f), f, t));
  }
View Full Code Here


    if (mouseDown)
    if (mousePiece!=null)
    if (mouseFrom!=null)
    if (mouseTo!=null)
    if (!mouseTo.equals(mouseFrom))
      listener.moveAction(new Move(mousePiece, mouseFrom, mouseTo));
   
    mouseDown = false;
  }
View Full Code Here

    engine.play();
  }

  public void run()
  {
    Move bestMove = null;
   
    aiLock.lock();
    try
    {
      TestingBoard c = new TestingBoard(board);
View Full Code Here

          t = new Spot(i, j+1);
          break;
        }
        if (b.validMove(f, t))
        {
          tmpM = new Move(b.getPiece(f), f, t);
          tmpB = new TestingBoard(b);
          tmpB.move(tmpM);
          threads[threadc] = new Thread()
          {
            public void run()
            {
              TestingBoard mytmpB = tmpB;
              Move mytmpM = tmpM;
              bLock.release();
              int tmpV = valueNMoves(mytmpB, n1, 0);
              tLock.lock();
              try
              {
View Full Code Here

        }
        if (b.validMove(f, t))
        {
          hasMove = true;
         
          Move tmpM = new Move(b.getPiece(f), f, t);
          Piece fp = b.getPiece(f);
          Piece tp = b.getPiece(t);
          b.move(tmpM);
          //int tmpV = valueBoard(b) + (int)(valueNMoves(b, n-1) * ALPHA);
          int tmpV = valueBoard(b);
View Full Code Here

          if (x2 < 0)
            to = Board.IN_TRAY;
          else
            to = new Spot(x2, y2);

          game.engine.requestMove(new Move(p, from, to), player);
          break;
        case PLAY:
          game.engine.play(player);
          break;
        default:
View Full Code Here

  {   
    //remember, tray pieces are at -1, -1 so this works
    if (m.getFrom().getY()>3)
      return false;
    if (m.getTo().getY()>3)
      m = new Move(m.getPiece(), m.getFrom(), IN_TRAY);
   
    if (m.getTo().equals(IN_TRAY))
      return remove(m.getFrom());
    else if (getPiece(m.getTo()) != null)
      return false;
View Full Code Here

          y = in.read();
       
        if (x<0||x>9||y<0||y>3)
          throw new Exception();
       
        board.move(new Move(board.getTrayPiece(0), EditorBoard.IN_TRAY, new Spot(x, y)));
      }
    }
    catch (IOException e)
    {
      JOptionPane.showMessageDialog(getJFrame(), "File Format Error: Unexpected end of file.",
View Full Code Here

TOP

Related Classes of net.sourceforge.java_stratego.stratego.Move

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.