congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
GdxAI.getTimepiece
Code IndexAdd Tabnine to your IDE (free)

How to use
getTimepiece
method
in
com.badlogic.gdx.ai.GdxAI

Best Java code snippets using com.badlogic.gdx.ai.GdxAI.getTimepiece (Showing top 20 results out of 315)

origin: libgdx/gdx-ai

/** Executes this {@code Wait} task.
 * @return {@link Status#SUCCEEDED} if the specified timeout has expired; {@link Status#RUNNING} otherwise. */
@Override
public Status execute () {
  return GdxAI.getTimepiece().getTime() - startTime < timeout ? Status.RUNNING : Status.SUCCEEDED;
}
origin: libgdx/gdx-ai

/** Draws a value from the distribution that determines the seconds to wait for.
 * <p>
 * This method is called when the task is entered. Also, this method internally calls {@link Timepiece#getTime()
 * GdxAI.getTimepiece().getTime()} to get the current AI time. This means that
 * <ul>
 * <li>if you forget to {@link Timepiece#update(float) update the timepiece} this task will keep running indefinitely.</li>
 * <li>the timepiece should be updated before this task runs.</li>
 * </ul> */
@Override
public void start () {
  timeout = seconds.nextFloat();
  startTime = GdxAI.getTimepiece().getTime();
}
origin: libgdx/gdx-ai

/** Scans the queue and passes pending messages to the given callback in any particular order.
 * <p>
 * Typically this method is used to save (serialize) pending messages and restore (deserialize and schedule) them back on game
 * loading.
 * @param callback The callback used to report pending messages individually. **/
public void scanQueue (PendingMessageCallback callback) {
  float currentTime = GdxAI.getTimepiece().getTime();
  int queueSize = queue.size();
  for (int i = 0; i < queueSize; i++) {
    Telegram telegram = queue.get(i);
    callback.report(telegram.getTimestamp() - currentTime, telegram.sender, telegram.receiver, telegram.message,
      telegram.extraInfo, telegram.returnReceiptStatus);
  }
}
origin: libgdx/gdx-ai

  float currentTime = GdxAI.getTimepiece().getTime();
  GdxAI.getLogger().info(
    LOG_TAG,
float currentTime = GdxAI.getTimepiece().getTime();
origin: libgdx/gdx-ai

/** Dispatches any delayed telegrams with a timestamp that has expired. Dispatched telegrams are removed from the queue.
 * <p>
 * This method must be called regularly from inside the main game loop to facilitate the correct and timely dispatch of any
 * delayed messages. Notice that the message dispatcher internally calls {@link Timepiece#getTime()
 * GdxAI.getTimepiece().getTime()} to get the current AI time and properly dispatch delayed messages. This means that
 * <ul>
 * <li>if you forget to {@link Timepiece#update(float) update the timepiece} the delayed messages won't be dispatched.</li>
 * <li>ideally the timepiece should be updated before the message dispatcher.</li>
 * </ul> */
public void update () {
  float currentTime = GdxAI.getTimepiece().getTime();
  // Peek at the queue to see if any telegrams need dispatching.
  // Remove all telegrams from the front of the queue that have gone
  // past their time stamp.
  Telegram telegram;
  while ((telegram = queue.peek()) != null) {
    // Exit loop if the telegram is in the future
    if (telegram.getTimestamp() > currentTime) break;
    if (debugEnabled) {
      GdxAI.getLogger().info(LOG_TAG,
        "Queued telegram ready for dispatch: Sent to " + telegram.receiver + ". Message code is " + telegram.message);
    }
    // Send the telegram to the recipient
    discharge(telegram);
    // Remove it from the queue
    queue.poll();
  }
}
origin: libgdx/gdx-ai

float currentTime = GdxAI.getTimepiece().getTime();
if (this.lastTime != currentTime) {
origin: com.badlogicgames.gdx/gdx-ai

/** Executes this {@code Wait} task.
 * @return {@link Status#SUCCEEDED} if the specified timeout has expired; {@link Status#RUNNING} otherwise. */
@Override
public Status execute () {
  return GdxAI.getTimepiece().getTime() - startTime < timeout ? Status.RUNNING : Status.SUCCEEDED;
}
origin: com.github.almasb/fxgl-ai

/** Executes this {@code Wait} task.
 * @return {@link Status#SUCCEEDED} if the specified timeout has expired; {@link Status#RUNNING} otherwise. */
@Override
public Status execute () {
  return GdxAI.getTimepiece().getTime() - startTime < timeout ? Status.RUNNING : Status.SUCCEEDED;
}
origin: libgdx/gdx-ai

float currentTime = GdxAI.getTimepiece().getTime();
if (this.lastTime != currentTime) {
origin: jsjolund/GdxDemo3D

protected void monitorAnimationTransition(DogCharacter dog, TaskAnimation ta) {
  if (dog.monitoredTaskAnimation != ta) {
    if (dog.currentTaskAnimation != null) {
      dog.monitoredTaskAnimation = ta;
      dog.switchAnimationTime = GdxAI.getTimepiece().getTime() + 0.2f;
      return;
    }
  }
  else if (dog.switchAnimationTime < GdxAI.getTimepiece().getTime()) {
    return;
  }
  // Start the new animation since the dog has maintained appropriate speed for long enough
  dog.currentTaskAnimation = ta;
  dog.monitoredTaskAnimation = null;
  dog.switchAnimationTime = -1;
  startAnimation(dog);
}
origin: libgdx/gdx-ai

@Override
protected SteeringAcceleration<T> calculateRealSteering (SteeringAcceleration<T> steering) {
  float now = GdxAI.getTimepiece().getTime();
  if (lastTime > 0) {
    float delta = now - lastTime;
origin: com.badlogicgames.gdx/gdx-ai

/** Draws a value from the distribution that determines the seconds to wait for.
 * <p>
 * This method is called when the task is entered. Also, this method internally calls {@link Timepiece#getTime()
 * GdxAI.getTimepiece().getTime()} to get the current AI time. This means that
 * <ul>
 * <li>if you forget to {@link Timepiece#update(float) update the timepiece} this task will keep running indefinitely.</li>
 * <li>the timepiece should be updated before this task runs.</li>
 * </ul> */
@Override
public void start () {
  timeout = seconds.nextFloat();
  startTime = GdxAI.getTimepiece().getTime();
}
origin: com.github.almasb/fxgl-ai

/** Draws a value from the distribution that determines the seconds to wait for.
 * <p>
 * This method is called when the task is entered. Also, this method internally calls {@link Timepiece#getTime()
 * GdxAI.getTimepiece().getTime()} to get the current AI time. This means that
 * <ul>
 * <li>if you forget to {@link Timepiece#update(float) update the timepiece} this task will keep running indefinitely.</li>
 * <li>the timepiece should be updated before this task runs.</li>
 * </ul> */
@Override
public void start () {
  timeout = seconds.nextFloat();
  startTime = GdxAI.getTimepiece().getTime();
}
origin: com.badlogicgames.gdx/gdx-ai

/** Scans the queue and passes pending messages to the given callback in any particular order.
 * <p>
 * Typically this method is used to save (serialize) pending messages and restore (deserialize and schedule) them back on game
 * loading.
 * @param callback The callback used to report pending messages individually. **/
public void scanQueue (PendingMessageCallback callback) {
  float currentTime = GdxAI.getTimepiece().getTime();
  int queueSize = queue.size();
  for (int i = 0; i < queueSize; i++) {
    Telegram telegram = queue.get(i);
    callback.report(telegram.getTimestamp() - currentTime, telegram.sender, telegram.receiver, telegram.message,
      telegram.extraInfo, telegram.returnReceiptStatus);
  }
}
origin: com.github.almasb/fxgl-ai

/**
 * Scans the queue and passes pending messages to the given callback in any particular order.
 * <p>
 * Typically this method is used to save (serialize) pending messages and restore (deserialize and schedule) them back on game
 * loading.
 *
 * @param callback The callback used to report pending messages individually.
 **/
public void scanQueue(PendingMessageCallback callback) {
  float currentTime = GdxAI.getTimepiece().getTime();
  int queueSize = queue.size();
  for (int i = 0; i < queueSize; i++) {
    Telegram telegram = queue.get(i);
    callback.report(telegram.getTimestamp() - currentTime, telegram.sender, telegram.receiver, telegram.message,
        telegram.extraInfo, telegram.returnReceiptStatus);
  }
}
origin: jsjolund/GdxDemo3D

public void update(float deltaTime) {
  // Update AI time
  GdxAI.getTimepiece().update(deltaTime);
  // Dispatch delayed messages
  MessageManager.getInstance().update();
  // Update Bullet simulation
  // On default fixedTimeStep = 1/60, small objects (the stick) will fall through 
  // the ground (the ground has relatively big triangles).
  dynamicsWorld.stepSimulation(deltaTime, 10, 1f / 240f);
  for (GameObject object : objectsById.values()) {
    if (object != null) {
      object.update(deltaTime);
    }
  }
}
origin: com.badlogicgames.gdx/gdx-ai

/** Dispatches any delayed telegrams with a timestamp that has expired. Dispatched telegrams are removed from the queue.
 * <p>
 * This method must be called regularly from inside the main game loop to facilitate the correct and timely dispatch of any
 * delayed messages. Notice that the message dispatcher internally calls {@link Timepiece#getTime()
 * GdxAI.getTimepiece().getTime()} to get the current AI time and properly dispatch delayed messages. This means that
 * <ul>
 * <li>if you forget to {@link Timepiece#update(float) update the timepiece} the delayed messages won't be dispatched.</li>
 * <li>ideally the timepiece should be updated before the message dispatcher.</li>
 * </ul> */
public void update () {
  float currentTime = GdxAI.getTimepiece().getTime();
  // Peek at the queue to see if any telegrams need dispatching.
  // Remove all telegrams from the front of the queue that have gone
  // past their time stamp.
  Telegram telegram;
  while ((telegram = queue.peek()) != null) {
    // Exit loop if the telegram is in the future
    if (telegram.getTimestamp() > currentTime) break;
    if (debugEnabled) {
      GdxAI.getLogger().info(LOG_TAG,
        "Queued telegram ready for dispatch: Sent to " + telegram.receiver + ". Message code is " + telegram.message);
    }
    // Send the telegram to the recipient
    discharge(telegram);
    // Remove it from the queue
    queue.poll();
  }
}
origin: tonihele/OpenKeeper

GdxAI.getTimepiece().update(tpf);
origin: com.github.almasb/fxgl-ai

/**
 * Dispatches any delayed telegrams with a timestamp that has expired. Dispatched telegrams are removed from the queue.
 * <p>
 * This method must be called regularly from inside the main game loop to facilitate the correct and timely dispatch of any
 * delayed messages. Notice that the message dispatcher internally calls {@link Timepiece#getTime()
 * GdxAI.getTimepiece().getTime()} to get the current AI time and properly dispatch delayed messages. This means that
 * <ul>
 * <li>if you forget to {@link Timepiece#update(float) update the timepiece} the delayed messages won't be dispatched.</li>
 * <li>ideally the timepiece should be updated before the message dispatcher.</li>
 * </ul>
 */
public void update() {
  float currentTime = GdxAI.getTimepiece().getTime();
  // Peek at the queue to see if any telegrams need dispatching.
  // Remove all telegrams from the front of the queue that have gone
  // past their time stamp.
  Telegram telegram;
  while ((telegram = queue.peek()) != null) {
    // Exit loop if the telegram is in the future
    if (telegram.getTimestamp() > currentTime) break;
    if (debugEnabled) {
      GdxAI.getLogger().info(LOG_TAG +
          "Queued telegram ready for dispatch: Sent to " + telegram.receiver + ". Message code is " + telegram.message);
    }
    // Send the telegram to the recipient
    discharge(telegram);
    // Remove it from the queue
    queue.poll();
  }
}
origin: com.badlogicgames.gdx/gdx-ai

@Override
protected SteeringAcceleration<T> calculateRealSteering (SteeringAcceleration<T> steering) {
  float now = GdxAI.getTimepiece().getTime();
  if (lastTime > 0) {
    float delta = now - lastTime;
com.badlogic.gdx.aiGdxAIgetTimepiece

Javadoc

Returns the timepiece service.

Popular methods of GdxAI

  • getLogger
    Returns the logger service.
  • getFileSystem
    Returns the filesystem service.

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Menu (java.awt)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • JTextField (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now