@Test public void testUnmarshall() throws Exception { GameScene theScene = mock(GameScene.class); GameObject theObject = mock(GameObject.class); when(theScene.findObjectByID(eq("UUID"))).thenReturn(theObject); Map<String, Object> theData = new HashMap<>(); theData.put(GameObjectInstanceLeftLayoutCondition.TYPE_ATTRIBUTE, GameObjectInstanceLeftLayoutCondition.TYPE_VALUE); GameObjectInstanceLeftLayoutCondition theCondition = GameObjectInstanceLeftLayoutCondition.unmarshall(theScene, theData); assertNotNull(theCondition); assertTrue(theCondition.gameObjectProperty().isNull()); theData.put("gameObjectUUID", "UUID"); GameObjectInstanceLeftLayoutCondition theCondition1 = GameObjectInstanceLeftLayoutCondition.unmarshall(theScene, theData); assertSame(theObject, theCondition1.gameObjectProperty().get()); verify(theScene, times(1)).findObjectByID(eq("UUID")); }
public static GameObjectInstanceLeftLayoutCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData) { GameObjectInstanceLeftLayoutCondition theResult = new GameObjectInstanceLeftLayoutCondition(); String theGameObjectUUID = (String) aSerializedData.get("gameObjectUUID"); if (theGameObjectUUID != null) { theResult.gameObject.setQuietly(aGameScene.findObjectByID(theGameObjectUUID)); } return theResult; }
GameObjectInstanceLeftLayoutCondition implements Condition { public static GameObjectInstanceLeftLayoutCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData) { GameObjectInstanceLeftLayoutCondition theResult = new GameObjectInstanceLeftLayoutCondition(); String theGameObjectUUID = (String) aSerializedData.get("gameObjectUUID"); if (theGameObjectUUID != null) { theResult.gameObject.setQuietly(aGameScene.findObjectByID(theGameObjectUUID)); } return theResult; } }
GameObjectInstanceLeftLayoutCondition implements Condition { public static GameObjectInstanceLeftLayoutCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData) { GameObjectInstanceLeftLayoutCondition theResult = new GameObjectInstanceLeftLayoutCondition(); String theGameObjectUUID = (String) aSerializedData.get("gameObjectUUID"); if (theGameObjectUUID != null) { theResult.gameObject.setQuietly(aGameScene.findObjectByID(theGameObjectUUID)); } return theResult; } @UsedByReflection  GameObjectInstanceLeftLayoutCondition(); }
GameObjectInstanceLeftLayoutCondition implements Condition { public static GameObjectInstanceLeftLayoutCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData) { GameObjectInstanceLeftLayoutCondition theResult = new GameObjectInstanceLeftLayoutCondition(); String theGameObjectUUID = (String) aSerializedData.get("gameObjectUUID"); if (theGameObjectUUID != null) { theResult.gameObject.setQuietly(aGameScene.findObjectByID(theGameObjectUUID)); } return theResult; } @UsedByReflection  GameObjectInstanceLeftLayoutCondition(); Property<GameObject> gameObjectProperty(); @Override ConditionResult appliesTo(GameScene aScene, GameEvent aEvent); @Override Map<String, Object> serialize(); static GameObjectInstanceLeftLayoutCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData); }
GameObjectInstanceLeftLayoutCondition implements Condition { public static GameObjectInstanceLeftLayoutCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData) { GameObjectInstanceLeftLayoutCondition theResult = new GameObjectInstanceLeftLayoutCondition(); String theGameObjectUUID = (String) aSerializedData.get("gameObjectUUID"); if (theGameObjectUUID != null) { theResult.gameObject.setQuietly(aGameScene.findObjectByID(theGameObjectUUID)); } return theResult; } @UsedByReflection  GameObjectInstanceLeftLayoutCondition(); Property<GameObject> gameObjectProperty(); @Override ConditionResult appliesTo(GameScene aScene, GameEvent aEvent); @Override Map<String, Object> serialize(); static GameObjectInstanceLeftLayoutCondition unmarshall(GameScene aGameScene, Map<String, Object> aSerializedData); static final String GAME_OBJECT_PROPERTY; }