feud.testgame
Class ExtendedDataContainer

java.lang.Object
  extended byfeud.clientserver.DataContainer
      extended byfeud.testgame.ExtendedDataContainer
All Implemented Interfaces:
java.lang.Cloneable

public class ExtendedDataContainer
extends DataContainer

An extended data container that offers support for transfering vectors, matrices and such. The container may contains multiple data sets.


Field Summary
 
Fields inherited from class feud.clientserver.DataContainer
ci, msgType, objs, pos, TYPE_BYTE, TYPE_FLOAT, TYPE_INT, TYPE_STRING, types
 
Constructor Summary
ExtendedDataContainer()
          Create a new container.
ExtendedDataContainer(DataContainer dc)
          Build a new extended data container from the content of a generic data container.
 
Method Summary
 void add(LocalObject lo)
          Adds a new LocalObject to the container.
 void add(com.threed.jpct.Matrix mat)
          Add a matrix to the container.
 void add(com.threed.jpct.SimpleVector sv)
          Adds a new SimpleVector to the container.
 void fillLocalObject(LocalObject lo)
          Fills an existing local object with the data from the container.
 LocalObject getLocalObject()
          Creates and returns a new LocalObject based on the based in the container.
 com.threed.jpct.Matrix getMatrix()
          Returns the next matrix from the container (if there is one, otherwise an identity matrix will be returned).
 com.threed.jpct.SimpleVector getSimpleVector()
          Returns the next SimpleVector from the container (is there is one, otherwise a null-vector will be returned).
 
Methods inherited from class feud.clientserver.DataContainer
add, add, add, add, clone, getBufferLength, getClientInfo, getLength, getMessageType, getNextByte, getNextFloat, getNextInt, getNextString, getRawData, getType, hasData, reset, setClientInfo, setMessageType, skip
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedDataContainer

public ExtendedDataContainer()
Create a new container.


ExtendedDataContainer

public ExtendedDataContainer(DataContainer dc)
Build a new extended data container from the content of a generic data container.

Parameters:
dc - DataContainer the generic data container
Method Detail

add

public void add(com.threed.jpct.Matrix mat)
Add a matrix to the container.

Parameters:
mat - Matrix the matrix to add

getMatrix

public com.threed.jpct.Matrix getMatrix()
Returns the next matrix from the container (if there is one, otherwise an identity matrix will be returned).

Returns:
Matrix the matrix

add

public void add(com.threed.jpct.SimpleVector sv)
Adds a new SimpleVector to the container.

Parameters:
sv - SimpleVector the vector

add

public void add(LocalObject lo)
Adds a new LocalObject to the container.

Parameters:
lo - LocalObject the object

fillLocalObject

public void fillLocalObject(LocalObject lo)
Fills an existing local object with the data from the container. The id will be ignored.

Parameters:
lo - LocalObject the object to fill

getLocalObject

public LocalObject getLocalObject()
Creates and returns a new LocalObject based on the based in the container.

Returns:
LocalObject the object

getSimpleVector

public com.threed.jpct.SimpleVector getSimpleVector()
Returns the next SimpleVector from the container (is there is one, otherwise a null-vector will be returned).

Returns:
SimpleVector the vector