feud.testgame.view
Class ClientObjectFactory

java.lang.Object
  extended byfeud.testgame.view.ClientObjectFactory

public class ClientObjectFactory
extends java.lang.Object

A small and dump factory that creates client objects. It can create one kind player model (includes the weapon) and one bullet model. That's sufficient for this example "game" but not enough for a real one.


Field Summary
static int BULLET
          Type: bullet
static int PLAYER
          Type: player
 
Method Summary
 ClientObject create(int type)
          Creates a new vlient object of the given type.
static ClientObjectFactory getInstance()
          Get the instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAYER

public static final int PLAYER
Type: player

See Also:
Constant Field Values

BULLET

public static final int BULLET
Type: bullet

See Also:
Constant Field Values
Method Detail

getInstance

public static ClientObjectFactory getInstance()
Get the instance. The Factory is a singleton.

Returns:
ClientObjectFactory the one and only instance

create

public ClientObject create(int type)
Creates a new vlient object of the given type.

Parameters:
type - the type
Returns:
ClientObject the new object