Examples of MapPoint


Examples of com.aldaviva.autorpg.data.types.MapPoint

  @Autowired
  private RealmMap worldMap;

  public void handleProgress(Character character) {
    MapPoint origin = character.getLocation();
    if (origin == null) {
      origin = new MapPoint();
      origin.x = Utils.getRandomInt(0, Integer.valueOf(Configuration.getValue(ConfigurationKey.MAP_WIDTH)));
      origin.y = Utils.getRandomInt(0, Integer.valueOf(Configuration.getValue(ConfigurationKey.MAP_HEIGHT)));
    }
    MapPoint destination = worldMap.getDestination(origin, RealmMap.MovementDirection.getRandomDirection());
    character.setLocation(destination);
    LOGGER.debug(character.getName() + " has walked to " + destination.x + ", " + destination.y);
  }
View Full Code Here

Examples of com.aldaviva.autorpg.data.types.MapPoint

      character.setCreated(new Date());
      character.setExperience(0);
      character.setLevel(1);
      character.setName(avatarName);
      character.setDesignation(designation);
      character.setLocation(new MapPoint(1, 1));
      character.setPlayer(player);
      character.setFemale(female);
     
      LOGGER.debug("new avatar's player attrib set to "+player.getName()+". Result of calling getter: "+character.getPlayer());
     
View Full Code Here

Examples of com.aldaviva.autorpg.data.types.MapPoint

  public void init(){
    LOGGER.debug("Initializing World Map.");
  }
 
  public MapPoint getDestination(MapPoint origin, MovementDirection movement) {
    MapPoint destination = new MapPoint();

    int upperX = Integer.parseInt(Configuration.getValue(ConfigurationKey.MAP_WIDTH));
    int lowerX = 0;
    int upperY = Integer.parseInt(Configuration.getValue(ConfigurationKey.MAP_HEIGHT));
    int lowerY = 0;
View Full Code Here

Examples of com.solfin.tools.MapPoint

            while (true) {
                try {
                    System.err.println("before readObject");
                    double lat=dis.readDouble();
                    double lon=dis.readDouble();
                    MapPoint mp=new MapPoint(lon,lat);
                    System.err.println("mp is="+mp.toString());
                    add(mp);
                } catch (IOException e) {
                    break;
                } catch (Exception e) {
                    System.err.println("Exception is "+e);
View Full Code Here

Examples of com.solfin.tools.MapPoint

    }
    public int closest(MapPoint point) {
        int closestIdx=-1;
        double distance=Double.MAX_VALUE;
        for (int i=0 ; i<numPoints ; ++i) {
            MapPoint p=points[i];
            double d=MapPoint.distanceMeeus(p, point).value();
            if (d<distance) {
                distance=d;
                closestIdx=i;
            }
View Full Code Here

Examples of com.solfin.tools.MapPoint

    public MapPoint getLastWaypoint() {
        return (numPoints>0 ? points[numPoints-1] : null);
    }
   
    public MapPoint getBoatEstPos(Calendar atTime) {
        MapPoint boatPos=new MapPoint();
        double boatSpeed=Speed.valueOfKnot(6.0).value(); /* knots*/
       
        /* the first point on the route starts now!
         * so lets calculate the distance the boat could have travelled between
         * now and 'atTime'
View Full Code Here

Examples of com.solfin.tools.MapPoint

        };
        return columnNames;
    }
    public Object[][] getAllData() {
        Double distance=0.0;
        MapPoint lastP=null;
       
        Object[][] d=new Object[numPoints][5];
        for (int i=0 ; i<numPoints ; ++i) {
            MapPoint p=points[i];
            d[i][0]=new Integer(i);
            d[i][1]=p.getLatitude();
            d[i][2]=p.getLongitude();
            //d[i][1]=Config.latitudeToString(p.getLatitude().value());
            //d[i][2]=Config.longitudeToString(p.getLongitude().value());
            if (i==0) {
                d[i][3]=new Double(0.0);
                d[i][4]=new Double(0.0);
View Full Code Here

Examples of com.solfin.tools.MapPoint

                retIdx[i]=Integer.MAX_VALUE;
                dists[i]=Double.MAX_VALUE;
            }
           
            for (int i=ni*nj-1 ; i>=0 ; --i) {
                MapPoint p2=new MapPoint(getLon(i),getLat(i));
               
                double dist=GribValue.distanceHaversine(p1, p2).value();
                if (dist > dists[lastI])
                    continue;
               
View Full Code Here

Examples of net.rim.device.api.lbs.maps.model.MapPoint

          //get current location - 4 tries or bust - in case of invalid fix
              BlackBerryLocation myLocation = getGeolocation(4);
         
              // Show location.
              if (myLocation != null){
                currSelection = new MapPoint(myLocation.getQualifiedCoordinates());
                PeerPoint point = new PeerPoint(myLocation.getQualifiedCoordinates().getLatitude(), myLocation.getQualifiedCoordinates().getLongitude());
                point.setAccuracy(MathUtilities.round(myLocation.getQualifiedCoordinates().getHorizontalAccuracy()));
               
                //auto zoom to point
                map.getAction().setCenterAndZoom(point);
               
                //add the point with accuracy circle
                map.getModel().add(point);
               
               
              }else{
                if (_ops != null){
                  double lat = Double.parseDouble((String) _ops.getField("lat"));
                  double lon = Double.parseDouble((String) _ops.getField("lon"));
                  int zoom = Integer.parseInt((String) _ops.getField("zoom"));
                  //get default location from options
                  map.getAction().setCenterAndZoom( new MapPoint( lat, lon ), zoom );
                }else{
                  //default location (ottawa with high zoom level)
                  map.getAction().setCenterAndZoom( new MapPoint( 45.417, -75.7 ), 10 );
                }
              }
        }
        catch (Exception e) {
          throw new RuntimeException(e.getMessage());
View Full Code Here

Examples of net.rim.device.api.lbs.maps.model.MapPoint

            final String lat = _editFieldLatitude.getText().trim();
            final String lon = _editFieldLongitude.getText().trim();

            if (lat.length() > 0 && lon.length() > 0) {
                try {
                    final MapPoint origin =
                            new MapPoint(Float.parseFloat(lat), Float
                                    .parseFloat(lon));
                    final AdminChoice choice =
                            (AdminChoice) _choiceField.getChoice(_choiceField
                                    .getSelectedIndex());
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.