Package BasicDataType

Examples of BasicDataType.MapUpdate


  /** Gets the packet as a MapUpdate
   * @return Returns the packet as a MapUpdate
   */
  public MapUpdate toMapUpdate() {
    return new MapUpdate(data[0], data[1], data[2]);
  }
View Full Code Here


     * Iterate through entire map and add visited squares to the ArrayList
     */
    for(int x=0; x < mapSize; x++)
      for(int y=0; y < mapSize; y++)
        if(grid[x][y].getVisits() != 0)
          visitedSquares.add(new MapUpdate(grid[x][y].getDiff(), (byte)x, (byte)y));

    return visitedSquares;
  }
View Full Code Here

     * Iterate through entire map and add visited squares to the ArrayList
     */
    for(int x=0; x < mapSize; x++)
      for(int y=0; y < mapSize; y++)
        if(grid[x][y].getVisits() != 0)
          visitedSquares.add(new MapUpdate(grid[x][y].getDiff(), (byte)x, (byte)y));

    return visitedSquares;
  }
View Full Code Here

  public byte getExpValue(){
    return this.data[0];
  }
 
  public MapUpdate toMapUpdate() {
    return new MapUpdate(data[0], data[1], data[2]);
  }
View Full Code Here

      //System.out.println("Trying to send");
      for (int i=0; i<127;i++){
        byte x = (byte)((3 * id + i) % 20);
        byte y = (byte)((125 * id + i) %20);
       
        MapUpdate mapup = new MapUpdate((byte)(id+1), x, y);
        com.sendMapUpdate(mapup);
        try{
          Thread.sleep(1000);
        }catch(Exception e){
          System.out.println("Thread sleep exception");
        }
      }
        try{
          Thread.sleep((int)rand.nextInt(n+1));
        }catch(Exception e){
          System.out.println("Thread sleep exception");
        }
     
      Button.waitForPress();
      com.removeListener(this);
    }
    else{
      System.out.println("Slave");
      com.addListener(this);
     
      for (int i=0; i<127;i++){
        byte x = (byte)((3 * id + i) % 20);
        byte y = (byte)((125 * id + i) % 20);
        if(id==3){
          MapUpdate mapup = new MapUpdate((byte)-1, x, y);
        }
        MapUpdate mapup = new MapUpdate((byte)(id+1), x, y);
        com.sendMapUpdate(mapup);
        try{
          Thread.sleep(1000);
        }catch(Exception e){
          System.out.println("Thread sleep exception");
View Full Code Here

     * Iterate through entire map and add visited squares to the ArrayList
     */
    for(int x=0; x < mapSize; x++)
      for(int y=0; y < mapSize; y++)
        if(grid[x][y].getVisits() != 0)
          visitedSquares.add(new MapUpdate(grid[x][y].getDiff(), (byte)x, (byte)y));

    return visitedSquares;
  }
View Full Code Here

TOP

Related Classes of BasicDataType.MapUpdate

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.