Ejemplo n.º 1
0
    private void ReadPinsFromWebservice() {
      try {

        ArrayList<Pin> pins =
            HeatMapSvc.Instance()
                .GetMoods(
                    GlobalSettings.Instance().getLocation(),
                    GlobalSettings.Instance().getVisibility(),
                    _currentMoodNumber);

        for (int i = 0; i < pins.size(); i++) {

          Location loc = new Location("");
          loc.setLatitude(pins.get(i).getLatitude() * 1000000);
          loc.setLongitude(pins.get(i).getLongitude() * 1000000);

          moodPointList.put(loc, HeatMapSvc.Instance().convertPinToMoodColor(pins.get(i)));

          _totalNumMoods = pins.get(0).getTotalPinCount();
          _currentMoodNumber = pins.get(i).getPinNumber();
        }
      } catch (Exception e) {
        e.printStackTrace();
      } // end catch
    }
Ejemplo n.º 2
0
  public void step() {
    Settings.AdvanceMoveNumber();
    System.out.println(Settings.getMoveNumber());
    Grid<Chess_Actor> gr = getGrid();
    ArrayList<Chess_Actor> actors = new ArrayList<Chess_Actor>();
    for (Location loc : gr.getOccupiedLocations()) actors.add(gr.get(loc));

    for (Chess_Actor a : actors) {
      // only act if another actor hasn't removed a
      // if (a.getGrid() == gr)
      //    a.act();
    }
  }
Ejemplo n.º 3
0
  public ArrayList<Obstacle> update(
      float timePerFrame, float toCenterX, float toCenterY, float attract) {
    super.update(timePerFrame, toCenterX, toCenterY, attract);

    ArrayList<Obstacle> spawnedObstacles = new ArrayList<Obstacle>();

    this.getImg().setRotation((float) (180 * this.getPolarPhi() / Math.PI));

    this.timeFromLastSpawn += timePerFrame;
    if (timeFromLastSpawn >= timeBetweenSpawns) {
      timeFromLastSpawn = 0;
      try {
        spawnedObstacles.add(
            new PowerupHealth(
                this.getCenterX(),
                this.getCenterY(),
                1,
                GlobalSettings.getGlobalSpeed(),
                new Image("res/images/lol.png")));
        System.out.println("health-powerup spawned");

      } catch (SlickException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return spawnedObstacles;
  }
Ejemplo n.º 4
0
 @Override
 public Attendance persist() {
   return GlobalSettings.dataSaver().save(this);
 }
Ejemplo n.º 5
0
 void clear(GlobalSettings global) {
   vwr.setShowAxes(false);
   vwr.setShowBbcage(false);
   vwr.setShowUnitCell(false);
   global.clear();
 }