feud.testgame
Class Event

java.lang.Object
  extended byfeud.testgame.Event

public class Event
extends java.lang.Object

An event is everything that the server and the other client should be notified of but that's not really physical, like a new position of the player would be.


Field Summary
static int BULLET_HIT
           
static int ENTITY_REMOVE
           
static int FIRE
           
static int PLAYER_DAMAGE
           
static int PLAYER_DEAD
           
static int PLAYER_RESET_HEALTH
           
static int PLAYER_RESPAWNED
           
 
Constructor Summary
Event(int type, int sourceID, int targetID, int targetClientID)
          Creates a new event.
Event(int type, LocalObject source, LocalObject target)
          Creates a new event.
 
Method Summary
 com.threed.jpct.SimpleVector getOrigin()
          Gets the origin of th event.
 int getSourceClientID()
          Returns the id of the source client.
 int getSourceID()
          Returns the id of the source object.
 int getTargetClientID()
          Returns the id of the target client
 int getTargetID()
          Returns the id of the target object.
 int getType()
          Returns the type of the event.
 int getValue()
          Returns the value for the event.
 void setOrigin(com.threed.jpct.SimpleVector org)
          Sets the origin of the event.
 void setSourceClientID(int id)
          Sets the id of the source client.
 void setValue(int val)
          Sets a value for the event.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BULLET_HIT

public static final int BULLET_HIT
See Also:
Constant Field Values

PLAYER_DAMAGE

public static final int PLAYER_DAMAGE
See Also:
Constant Field Values

PLAYER_DEAD

public static final int PLAYER_DEAD
See Also:
Constant Field Values

ENTITY_REMOVE

public static final int ENTITY_REMOVE
See Also:
Constant Field Values

FIRE

public static final int FIRE
See Also:
Constant Field Values

PLAYER_RESPAWNED

public static final int PLAYER_RESPAWNED
See Also:
Constant Field Values

PLAYER_RESET_HEALTH

public static final int PLAYER_RESET_HEALTH
See Also:
Constant Field Values
Constructor Detail

Event

public Event(int type,
             int sourceID,
             int targetID,
             int targetClientID)
Creates a new event. This is used for creating bullet hit events.

Parameters:
type - int the type of the event. See the constants above of possible types.
sourceID - int the object id of the source object triggering this event (if any)
targetID - int the id of the target object of this event (if any).
targetClientID - int the id of the target client

Event

public Event(int type,
             LocalObject source,
             LocalObject target)
Creates a new event.

Parameters:
type - int the type of the event. See the constants above of possible types.
source - LocalObject the source object of the event
target - LocalObject the target object of the event
Method Detail

setOrigin

public void setOrigin(com.threed.jpct.SimpleVector org)
Sets the origin of the event. Not all events have this.

Parameters:
org - SimpleVector the origin

getOrigin

public com.threed.jpct.SimpleVector getOrigin()
Gets the origin of th event. Not all events have this.

Returns:
SimpleVector the origin

setValue

public void setValue(int val)
Sets a value for the event. Not all events have this.

Parameters:
val - int the value

getValue

public int getValue()
Returns the value for the event. Not all events have this.

Returns:
int the value

getType

public int getType()
Returns the type of the event.

Returns:
int the type

setSourceClientID

public void setSourceClientID(int id)
Sets the id of the source client.

Parameters:
id - int the id

getSourceClientID

public int getSourceClientID()
Returns the id of the source client.

Returns:
int the id

getSourceID

public int getSourceID()
Returns the id of the source object.

Returns:
int the id

getTargetID

public int getTargetID()
Returns the id of the target object.

Returns:
int the id

getTargetClientID

public int getTargetClientID()
Returns the id of the target client

Returns:
int the if

toString

public java.lang.String toString()