org.starhope.appius.game
Class PhysicsScheduler

java.lang.Object
  extended by org.starhope.appius.game.PhysicsScheduler

public class PhysicsScheduler
extends Object

Run physics/simulation tasks on a fixed schedule without taxing the global metronome

Author:
brpocock@star-hope.org

Nested Class Summary
private static class PhysicsScheduler.Crankshaft
          helper class buddy
 
Field Summary
private static ConcurrentHashMap<AcceptsMetronomeTicks,ScheduledFuture<?>> futures
          Who's scheduled
private static ScheduledExecutorService scheduler
          Universal scheduler
 
Constructor Summary
PhysicsScheduler()
           
 
Method Summary
static void purgeFutures()
          Look for errors in the futures
static void shutdown()
          stop all currently-scheduled threads
static ScheduledFuture<?> start(AcceptsMetronomeTicks engine)
          start a new timer thread
static void stop(AcceptsMetronomeTicks engine)
          stop ticking a fellow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

futures

private static ConcurrentHashMap<AcceptsMetronomeTicks,ScheduledFuture<?>> futures
Who's scheduled


scheduler

private static final ScheduledExecutorService scheduler
Universal scheduler

Constructor Detail

PhysicsScheduler

public PhysicsScheduler()
Method Detail

purgeFutures

public static void purgeFutures()
Look for errors in the futures


shutdown

public static void shutdown()
stop all currently-scheduled threads


start

public static ScheduledFuture<?> start(AcceptsMetronomeTicks engine)
start a new timer thread

Parameters:
engine - who
Returns:
the future

stop

public static void stop(AcceptsMetronomeTicks engine)
stop ticking a fellow

Parameters:
engine - who