de.rico.engine.cursor
Class CursorManager

java.lang.Object
  extended by de.rico.engine.cursor.CursorManager

public class CursorManager
extends java.lang.Object

This class represents a cursor manager that provides the different cursors for the game. It implements the usual singleton pattern.

Author:
Frank Bruns

Method Summary
 void addCursor(GameCursor cursor)
          Adds a new game cursor to the cursor pool with the specified parameters
 void draw(javax.media.opengl.GL gl, int screenX, int screenY)
          Draws the current game cursor icon at the specified screen location.
 GameCursor getCurrCursor()
          Returns the current game cursor
 java.lang.Enum getCurrCursorId()
          Returns the enum cursor id of the current cursor.
 GameCursor getCursor(java.lang.Enum id)
          Returns the cursor refering to the specified id enum.
static CursorManager getInstance()
          Returns the cursor manager's singleton instance.
 void setCursor(java.lang.Enum id)
          Sets the mouse pointer to the specified cursor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CursorManager getInstance()
Returns the cursor manager's singleton instance.

Returns:
cursor manager's singleton instance

addCursor

public void addCursor(GameCursor cursor)
Adds a new game cursor to the cursor pool with the specified parameters

Parameters:
cursor - game cursor to add to the cursor pool

getCursor

public GameCursor getCursor(java.lang.Enum id)
Returns the cursor refering to the specified id enum.

Parameters:
id - use an enum value from a custom enum class
Returns:
cursor refering to the specified id

setCursor

public void setCursor(java.lang.Enum id)
Sets the mouse pointer to the specified cursor

Parameters:
id - enum value refering to the cursor

getCurrCursor

public GameCursor getCurrCursor()
Returns the current game cursor

Returns:
current game cursor

getCurrCursorId

public java.lang.Enum getCurrCursorId()
Returns the enum cursor id of the current cursor.

Returns:
enum cursor id of the current cursor

draw

public void draw(javax.media.opengl.GL gl,
                 int screenX,
                 int screenY)
Draws the current game cursor icon at the specified screen location.

Parameters:
gl -
screenX - screen x-coordinate
screenY - screen y-coordinate