@Test public void testGetBehaviorTemplates() throws Exception { GameEventManager theEventManager = mock(GameEventManager.class); GameRuntime theRuntime = mock(GameRuntime.class); when(theRuntime.getEventManager()).thenReturn(theEventManager); GameScene theScene = mock(GameScene.class); when(theScene.getRuntime()).thenReturn(theRuntime); BehaviorTemplate theBehavior = mock(BehaviorTemplate.class); GameObject theObject = new GameObject(theScene, "Test"); Set<BehaviorTemplate> theBehaviors = theObject.getBehaviorTemplates(); assertEquals(0, theBehaviors.size()); theObject.add(theBehavior); theBehaviors = theObject.getBehaviorTemplates(); assertEquals(1, theBehaviors.size()); assertSame(theBehavior, theBehaviors.iterator().next()); }
public Set<BehaviorTemplate> getBehaviorTemplates() { HashSet<BehaviorTemplate> theResult = new HashSet<>(); theResult.addAll(behaviors.values()); return theResult; }
GameObject implements Reflectable<GameObjectClassInformation> { public Set<BehaviorTemplate> getBehaviorTemplates() { HashSet<BehaviorTemplate> theResult = new HashSet<>(); theResult.addAll(behaviors.values()); return theResult; } }
GameObject implements Reflectable<GameObjectClassInformation> { public Set<BehaviorTemplate> getBehaviorTemplates() { HashSet<BehaviorTemplate> theResult = new HashSet<>(); theResult.addAll(behaviors.values()); return theResult; } GameObject(GameScene aScene, String aName);   GameObject(GameScene aScene, String aName, String aUUID); }
GameObject implements Reflectable<GameObjectClassInformation> { public Set<BehaviorTemplate> getBehaviorTemplates() { HashSet<BehaviorTemplate> theResult = new HashSet<>(); theResult.addAll(behaviors.values()); return theResult; } GameObject(GameScene aScene, String aName);   GameObject(GameScene aScene, String aName, String aUUID); GameScene getGameScene(); @ReflectiveField Property<String> uuidProperty(); @ReflectiveField Property<String> nameProperty(); @ReflectiveField Property<Size> sizeProperty(); @ReflectiveField Property<Boolean> visibleProperty(); @Override boolean equals(Object o); @Override int hashCode(); void add(BehaviorTemplate aBehaviorTemplate); void remove(BehaviorTemplate aBehaviorTemplate); T getBehaviorTemplate(BehaviorType aType); @Override GameObjectClassInformation getClassInformation(); Set<BehaviorTemplate> getBehaviorTemplates(); Map<String, Object> serialize(); static GameObject deserialize(GameRuntime aGameRuntime, GameScene aGameScene, Map<String, Object> theSerializedData); }
GameObject implements Reflectable<GameObjectClassInformation> { public Set<BehaviorTemplate> getBehaviorTemplates() { HashSet<BehaviorTemplate> theResult = new HashSet<>(); theResult.addAll(behaviors.values()); return theResult; } GameObject(GameScene aScene, String aName);   GameObject(GameScene aScene, String aName, String aUUID); GameScene getGameScene(); @ReflectiveField Property<String> uuidProperty(); @ReflectiveField Property<String> nameProperty(); @ReflectiveField Property<Size> sizeProperty(); @ReflectiveField Property<Boolean> visibleProperty(); @Override boolean equals(Object o); @Override int hashCode(); void add(BehaviorTemplate aBehaviorTemplate); void remove(BehaviorTemplate aBehaviorTemplate); T getBehaviorTemplate(BehaviorType aType); @Override GameObjectClassInformation getClassInformation(); Set<BehaviorTemplate> getBehaviorTemplates(); Map<String, Object> serialize(); static GameObject deserialize(GameRuntime aGameRuntime, GameScene aGameScene, Map<String, Object> theSerializedData); static final String UUID_PROPERTY; static final String NAME_PROPERTY; static final String SIZE_PROPERTY; static final String VISIBLE_PROPERTY; }