Esempio n. 1
0
 public synchronized void add_block(int pieceIndex, int offset, int size, byte[] b) {
   Piece p = this.pieces.get(pieceIndex);
   p.writeBlock(b, offset);
   if (p.haveAllBlocks() == 1) {
     this.finished_pieces[pieceIndex] = true;
     // System.out.println("verified");
   }
   return;
 }
 public void move(Piece p, Position pos) {
   String s =
       ask(
           "move:"
               + p.getPos().getX()
               + ":"
               + p.getPos().getY()
               + ":"
               + pos.getX()
               + ":"
               + pos.getY()
               + ";");
   System.out.println(s);
 }