Package org.jbox2d.serialization.pb
Class PbDeserializer
- java.lang.Object
-
- org.jbox2d.serialization.pb.PbDeserializer
-
- All Implemented Interfaces:
JbDeserializer
public class PbDeserializer extends java.lang.Object implements JbDeserializer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jbox2d.serialization.JbDeserializer
JbDeserializer.ObjectListener
-
-
Field Summary
Fields Modifier and Type Field Description private JbDeserializer.ObjectListenerlistenerprivate UnsupportedListenerulistener
-
Constructor Summary
Constructors Constructor Description PbDeserializer()PbDeserializer(JbDeserializer.ObjectListener argObjectListner)PbDeserializer(UnsupportedListener argListener)PbDeserializer(UnsupportedListener argListener, JbDeserializer.ObjectListener argObjectListner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BodydeserializeBody(World argWorld, java.io.InputStream argInput)Deserializes a bodyBodydeserializeBody(World argWorld, Box2D.PbBody argBody)FixturedeserializeFixture(Body argBody, java.io.InputStream argInput)Deserializes a fixtureFixturedeserializeFixture(Body argBody, Box2D.PbFixture argFixture)JointdeserializeJoint(World argWorld, java.io.InputStream argInput, java.util.Map<java.lang.Integer,Body> argBodyMap, java.util.Map<java.lang.Integer,Joint> jointMap)Deserializes a jointJointdeserializeJoint(World argWorld, Box2D.PbJoint joint, java.util.Map<java.lang.Integer,Body> argBodyMap, java.util.Map<java.lang.Integer,Joint> jointMap)ShapedeserializeShape(java.io.InputStream argInput)Deserializes a shapeShapedeserializeShape(Box2D.PbShape argShape)WorlddeserializeWorld(java.io.InputStream argInput)Deserializes a worldWorlddeserializeWorld(Box2D.PbWorld pbWorld)private booleanisIndependentJoint(Box2D.PbJointType argType)private Vec2pbToVec(Box2D.PbVec2 argVec)voidsetObjectListener(JbDeserializer.ObjectListener argListener)Sets the object listener, which allows the user to process each physics object with a tag to do any sort of custom logic.voidsetUnsupportedListener(UnsupportedListener argListener)Sets a listener for unsupported exceptions instead of stopping the whole deserialization process by throwing and exception.
-
-
-
Field Detail
-
listener
private JbDeserializer.ObjectListener listener
-
ulistener
private UnsupportedListener ulistener
-
-
Constructor Detail
-
PbDeserializer
public PbDeserializer()
-
PbDeserializer
public PbDeserializer(UnsupportedListener argListener)
-
PbDeserializer
public PbDeserializer(JbDeserializer.ObjectListener argObjectListner)
-
PbDeserializer
public PbDeserializer(UnsupportedListener argListener, JbDeserializer.ObjectListener argObjectListner)
-
-
Method Detail
-
setObjectListener
public void setObjectListener(JbDeserializer.ObjectListener argListener)
Description copied from interface:JbDeserializerSets the object listener, which allows the user to process each physics object with a tag to do any sort of custom logic.- Specified by:
setObjectListenerin interfaceJbDeserializer
-
setUnsupportedListener
public void setUnsupportedListener(UnsupportedListener argListener)
Description copied from interface:JbDeserializerSets a listener for unsupported exceptions instead of stopping the whole deserialization process by throwing and exception.- Specified by:
setUnsupportedListenerin interfaceJbDeserializer
-
isIndependentJoint
private boolean isIndependentJoint(Box2D.PbJointType argType)
-
deserializeWorld
public World deserializeWorld(java.io.InputStream argInput) throws java.io.IOException
Description copied from interface:JbDeserializerDeserializes a world- Specified by:
deserializeWorldin interfaceJbDeserializer- Returns:
- Throws:
java.io.IOException- See Also:
JbDeserializer.setUnsupportedListener(UnsupportedListener)
-
deserializeWorld
public World deserializeWorld(Box2D.PbWorld pbWorld)
-
deserializeBody
public Body deserializeBody(World argWorld, java.io.InputStream argInput) throws java.io.IOException
Description copied from interface:JbDeserializerDeserializes a body- Specified by:
deserializeBodyin interfaceJbDeserializer- Returns:
- Throws:
java.io.IOException- See Also:
JbDeserializer.setUnsupportedListener(UnsupportedListener)
-
deserializeBody
public Body deserializeBody(World argWorld, Box2D.PbBody argBody)
-
deserializeFixture
public Fixture deserializeFixture(Body argBody, java.io.InputStream argInput) throws java.io.IOException
Description copied from interface:JbDeserializerDeserializes a fixture- Specified by:
deserializeFixturein interfaceJbDeserializer- Returns:
- Throws:
java.io.IOException- See Also:
JbDeserializer.setUnsupportedListener(UnsupportedListener)
-
deserializeFixture
public Fixture deserializeFixture(Body argBody, Box2D.PbFixture argFixture)
-
deserializeShape
public Shape deserializeShape(java.io.InputStream argInput) throws java.io.IOException
Description copied from interface:JbDeserializerDeserializes a shape- Specified by:
deserializeShapein interfaceJbDeserializer- Returns:
- Throws:
java.io.IOException- See Also:
JbDeserializer.setUnsupportedListener(UnsupportedListener)
-
deserializeShape
public Shape deserializeShape(Box2D.PbShape argShape)
-
deserializeJoint
public Joint deserializeJoint(World argWorld, java.io.InputStream argInput, java.util.Map<java.lang.Integer,Body> argBodyMap, java.util.Map<java.lang.Integer,Joint> jointMap) throws java.io.IOException
Description copied from interface:JbDeserializerDeserializes a joint- Specified by:
deserializeJointin interfaceJbDeserializer- Returns:
- Throws:
java.io.IOException- See Also:
JbDeserializer.setUnsupportedListener(UnsupportedListener)
-
deserializeJoint
public Joint deserializeJoint(World argWorld, Box2D.PbJoint joint, java.util.Map<java.lang.Integer,Body> argBodyMap, java.util.Map<java.lang.Integer,Joint> jointMap)
-
pbToVec
private Vec2 pbToVec(Box2D.PbVec2 argVec)
-
-