Android Open Source - Save-the-Planet I Tickable






From Project

Back to project page Save-the-Planet.

License

The source code is released under:

Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software ...

If you think the Android project Save-the-Planet listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.karolmajta.stp.models;
/*  w w  w.j  av a 2  s.  c om*/
/**
 * This interface describes any object that can be notified about the time
 * elapsed between calls. It is used in game loop to provide time data for
 * physics and graphics, so that they're based on "real world's" values,
 * not the frame rate that can be not consistent between devices. 
 * 
 * @author Karol Majta
 */
public interface ITickable {
  
  /**
   * Called to notify object on how many time elapsed
   * since last call to {@link ITickable#tick(long)}.
   * 
   * @param dt Time in milliseconds since last call to
   *     {@link ITickable#tick(long)} 
   */
  public void tick(long dt);
  
  /**
   * Called to mark this object as ignoring calls to {@link ITickable#tick(long)}.
   * Implementation of this method is free. There is no guarantee that after calling
   * {@link ITickable#ignoreTicks(boolean)} {@link ITickable#ignoresTicks()} will
   * change it's returned value. The only requirement is to keep
   * {@link ITickable#ignoresTicks()} with sync with the state of the object. So
   * if you plan to ignore calls to {@link ITickable#tick(long)} let the user know
   * by changing the behavior of {@link ITickable#ignoresTicks()}.
   * 
   * @param flag boolean indicator of whether calls to {@link ITickable#tick(long)}
   *     should be ignored or not.
   */
  public void ignoreTicks(boolean flag);
  
  /**
   * Returns a value whether this object ignores calls to {@link ITickable#tick(long)}
   * or not. Keep in mind that the value is just an indicator, and it is possible to
   * implement this interface in such way, that calls to {@link ITickable#tick(long)}
   * will affect state of the object.
   * 
   * @return boolean indicator of whether this object is expected to ignore calls
   *     to {@link ITickable#tick()} or not
   */
  public boolean ignoresTicks();
}




Java Source Code List

com.karolmajta.procprox.DragDetector.java
com.karolmajta.procprox.Drag.java
com.karolmajta.procprox.FontManager.java
com.karolmajta.procprox.IEventFilter.java
com.karolmajta.procprox.TapDetector.java
com.karolmajta.procprox.Tap.java
com.karolmajta.procprox.excepiton.FontNotCreatedException.java
com.karolmajta.stp.LoadingScreenActivity.java
com.karolmajta.stp.MainMenuActivity.java
com.karolmajta.stp.exception.NoDeferredException.java
com.karolmajta.stp.exception.NoTasksInProgressQueueException.java
com.karolmajta.stp.exception.STPException.java
com.karolmajta.stp.exception.UnboundViewException.java
com.karolmajta.stp.models.ICanCollide.java
com.karolmajta.stp.models.IPConstants.java
com.karolmajta.stp.models.IProgress.java
com.karolmajta.stp.models.ITask.java
com.karolmajta.stp.models.ITickable.java
com.karolmajta.stp.models.MainMenuItemBall.java
com.karolmajta.stp.models.MainMenuObstacleBall.java
com.karolmajta.stp.models.ObstacleManager.java
com.karolmajta.stp.models.SyncProgress.java
com.karolmajta.stp.models.SyncTask.java
com.karolmajta.stp.models.Tickable.java
com.karolmajta.stp.models.Viewport.java
com.karolmajta.stp.views.FancyTextView.java
com.karolmajta.stp.views.IDrawable.java
com.karolmajta.stp.views.MainMenuItemBallDebugView.java
com.karolmajta.stp.views.MainMenuItemBallView.java
com.karolmajta.stp.views.MainMenuObstacleBallDebugView.java
com.karolmajta.stp.views.MainMenuObstacleBallView.java
com.karolmajta.stp.views.ObstacleManagerView.java
com.karolmajta.stp.views.ProgressDebugView.java
com.karolmajta.stp.views.ProgressView.java
com.karolmajta.stp.views.View.java