@Test public void testDeserialize() throws Exception { SpriteBehaviorTemplateUnmarshaller theUnmarshaller = new SpriteBehaviorTemplateUnmarshaller(); GameEventManager theManager = mock(GameEventManager.class); GameObject theObject = mock(GameObject.class); Map<String, Object> theData = new HashMap<>(); theData.put(SpriteBehavior.TYPE_ATTRIBUTE, SpriteBehavior.TYPE); theData.put("resourcename", new ResourceName("Lala").serialize()); SpriteBehaviorTemplate theTemplate = theUnmarshaller.deserialize(theManager, theObject, theData); assertEquals(Integer.valueOf(5), theTemplate.speedProperty().get()); assertEquals(1, theTemplate.getAnimations().length); Animation theDefaultAnimation = theTemplate.getAnimations()[0]; assertEquals("Default", theDefaultAnimation.getName()); assertSame(theDefaultAnimation, theTemplate.currentAnimationProperty().get()); assertEquals(1, theDefaultAnimation.getSequenceSize()); assertEquals(new ResourceName("Lala"), theDefaultAnimation.getResourceByIndex(0)); }
@Override public SpriteBehaviorTemplate deserialize(GameEventManager aEventmanager, GameObject aOwner, Map<String, Object> aSerializedData) { return SpriteBehaviorTemplate.deserialize(aEventmanager, aOwner, aSerializedData); }
SpriteBehaviorTemplateUnmarshaller implements BehaviorTemplateUnmarshaller<SpriteBehaviorTemplate> { @Override public SpriteBehaviorTemplate deserialize(GameEventManager aEventmanager, GameObject aOwner, Map<String, Object> aSerializedData) { return SpriteBehaviorTemplate.deserialize(aEventmanager, aOwner, aSerializedData); } }
SpriteBehaviorTemplateUnmarshaller implements BehaviorTemplateUnmarshaller<SpriteBehaviorTemplate> { @Override public SpriteBehaviorTemplate deserialize(GameEventManager aEventmanager, GameObject aOwner, Map<String, Object> aSerializedData) { return SpriteBehaviorTemplate.deserialize(aEventmanager, aOwner, aSerializedData); }  }
SpriteBehaviorTemplateUnmarshaller implements BehaviorTemplateUnmarshaller<SpriteBehaviorTemplate> { @Override public SpriteBehaviorTemplate deserialize(GameEventManager aEventmanager, GameObject aOwner, Map<String, Object> aSerializedData) { return SpriteBehaviorTemplate.deserialize(aEventmanager, aOwner, aSerializedData); }  @Override BehaviorType getTypeKey(); @Override SpriteBehaviorTemplate deserialize(GameEventManager aEventmanager, GameObject aOwner, Map<String, Object> aSerializedData); }
SpriteBehaviorTemplateUnmarshaller implements BehaviorTemplateUnmarshaller<SpriteBehaviorTemplate> { @Override public SpriteBehaviorTemplate deserialize(GameEventManager aEventmanager, GameObject aOwner, Map<String, Object> aSerializedData) { return SpriteBehaviorTemplate.deserialize(aEventmanager, aOwner, aSerializedData); }  @Override BehaviorType getTypeKey(); @Override SpriteBehaviorTemplate deserialize(GameEventManager aEventmanager, GameObject aOwner, Map<String, Object> aSerializedData);  }