Android Open Source - misty Alarm






From Project

Back to project page misty.

License

The source code is released under:

MIT License

If you think the Android project misty 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.misty.kernel;
//from   w  ww  . j av  a  2 s  .com
public class Alarm
{
  public final int id;
  private final OnAlarmRing listener;
  private final long time;
  private float total = 0;
  
  public Alarm(int id, OnAlarmRing listener, long time)
  {
    this.id = id;
    this.listener = listener;
    this.time = time;
    this.total = 0;
  }
  
  public boolean step(float delta)
  {
    boolean remove = false;
    this.total += (delta * 1E3f);
    
    if (this.total >= this.time)
    {
      remove = (!this.listener.onAlarmRing());
      this.total -= this.time;
    }
    
    return remove;
  }
  
  public interface OnAlarmRing
  {
    public boolean onAlarmRing();
  }
}




Java Source Code List

com.misty.audio.AudioManager.java
com.misty.debug.FPS.java
com.misty.debug.TimeCounter.java
com.misty.graphics.Animation.java
com.misty.graphics.Camera.java
com.misty.graphics.CollisionGrid.java
com.misty.graphics.Renderer.java
com.misty.graphics.ScreenResolution.java
com.misty.graphics.textures.TextureManager.java
com.misty.graphics.textures.Texture.java
com.misty.input.TouchEvent.java
com.misty.kernel.Alarm.java
com.misty.kernel.Engine.java
com.misty.kernel.Misty.java
com.misty.kernel.Process.java
com.misty.math.Rectangle.java
com.misty.math.Utils.java
com.misty.math.Vector.java
com.misty.utils.Assets.java