Example #1
0
  public void update() {
    myDraDebugger.update(this);

    if (myPaused) return;

    myTimeFactor = DebugOptions.GAME_SPEED_MULTIPLIER;
    if (myHero != null) {
      ShipAbility ability = myHero.getAbility();
      if (ability instanceof SloMo) {
        float factor = ((SloMo) ability).getFactor();
        myTimeFactor *= factor;
      }
    }
    myTimeStep = Const.REAL_TIME_STEP * myTimeFactor;
    myTime += myTimeStep;

    myPlanetManager.update(this);
    myCam.update(this);
    myChunkManager.update(this);
    myMountDetectDrawer.update(this);
    myObjectManager.update(this);
    myDraMan.update(this);
    myMapDrawer.update(this);
    mySoundManager.update(this);
    myBeaconHandler.update(this);

    myHero = null;
    myTranscendentHero = null;
    List<SolObject> objs = myObjectManager.getObjs();
    for (int i = 0, objsSize = objs.size(); i < objsSize; i++) {
      SolObject obj = objs.get(i);
      if ((obj instanceof SolShip)) {
        SolShip ship = (SolShip) obj;
        Pilot prov = ship.getPilot();
        if (prov.isPlayer()) {
          myHero = ship;
          break;
        }
      }
      if (obj instanceof StarPort.Transcendent) {
        StarPort.Transcendent trans = (StarPort.Transcendent) obj;
        FarShip ship = trans.getShip();
        if (ship.getPilot().isPlayer()) {
          myTranscendentHero = trans;
          break;
        }
      }
    }

    if (myTutorialManager != null) myTutorialManager.update();
  }
  public void run() {
    // TODO Auto-generated method stub
    mLastTime = SystemClock.uptimeMillis();
    mFinished = false;
    while (!mFinished) {

      if (mGameRoot != null) {
        // Wait for Rendering Thread to Finish

        mRenderer.checkRenderingIsFinshed();
        final long time = SystemClock.uptimeMillis();
        final long timeDelta = time - mLastTime;

        if (timeDelta > 12) {
          float secondsDelta = (time - mLastTime) * 0.001f;
          if (secondsDelta > 0.1f) {
            secondsDelta = 0.1f;
          }
          // TODO This is the game root, will be used to update objects under it!
          mGameRoot.update(secondsDelta, null);

          // TODO get camera positions and pass below
          // This calls the setRenderQueue in render system which will eventually set the rendering
          // thread to
          // a queue of objects

          BaseObject.renderSystem.swapQueue(mRenderer, 10f, 10f);

          mLastTime = SystemClock.uptimeMillis();
        } else {
        }
      }
    }
    BaseObject.renderSystem.emptyQueues(mRenderer);
    mRenderer.clearAllTextures(); // Clear all textures
    BaseObject.resetAllElements(); // resets everything except textures
  }
Example #3
0
 /**
  * upravi zadani do db
  *
  * @param zadani - upravene zadani
  */
 @Override
 @RolesAllowed({"admin", "kantor"})
 public void updateZadani(Zadani zadani) {
   super.update(zadani);
 }