crystalspace.jbind.interfaces.iutil.virtclk
Interface iVirtualClock

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csVirtualClock

public interface iVirtualClock
extends iBase

A virtual game clock. Normally, a single instance of iVirtualClock is placed in the shared object registry (iObjectRegistry).

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiVirtualClock.php

Method Summary
 void advance()
          Advance the engine's virtual-time clock.
 int getCurrentTicks()
          Returns the absolute time of the last call to Advance();.
 int getElapsedTicks()
          Query the time elapsed between the two most recent invocations of Advance();.
 void resume()
          Resume the engine's virtual-time clock.
 void suspend()
          Suspend the engine's virtual-time clock.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

advance

public void advance()
Advance the engine's virtual-time clock. Implemented in csVirtualClock, and csMovieRecorder::VirtualClock.


getCurrentTicks

public int getCurrentTicks()
Returns the absolute time of the last call to Advance();. For game logic you should always use this function instead of csGetTicks();. Implemented in csVirtualClock, and csMovieRecorder::VirtualClock. Referenced by csSprite3DMeshObject::SetAction();.

Returns:

getElapsedTicks

public int getElapsedTicks()
Query the time elapsed between the two most recent invocations of Advance();. Implemented in csVirtualClock, and csMovieRecorder::VirtualClock.

Returns:

resume

public void resume()
Resume the engine's virtual-time clock. Call this function when the client application begins invoking Advance(); again after extended down-time. This function is the complement of Suspend();. Implemented in csVirtualClock, and csMovieRecorder::VirtualClock.


suspend

public void suspend()
Suspend the engine's virtual-time clock. Call this function when the client application will fail to call Advance(); for an extended period of time. Suspending the virtual-time clock prevents a temporal anomaly from occurring the next time GetElapsedTicks(); is called after the application resumes invoking Advance();. Implemented in csVirtualClock, and csMovieRecorder::VirtualClock.