@Test public void testEquals() 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); GameObject theObject = new GameObject(theScene, "Test"); assertEquals(theObject, theObject); assertNotEquals(theObject, null); assertNotEquals(theObject, "lala"); GameObject theObject2 = new GameObject(theScene, "Test"); theObject2.uuidProperty().set(theObject.uuidProperty().get()); assertEquals(theObject, theObject2); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GameObject that = (GameObject) o; return uuid.get().equals(that.uuid.get()); }
GameObject implements Reflectable<GameObjectClassInformation> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GameObject that = (GameObject) o; return uuid.get().equals(that.uuid.get()); } }
GameObject implements Reflectable<GameObjectClassInformation> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GameObject that = (GameObject) o; return uuid.get().equals(that.uuid.get()); } GameObject(GameScene aScene, String aName);   GameObject(GameScene aScene, String aName, String aUUID); }
GameObject implements Reflectable<GameObjectClassInformation> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GameObject that = (GameObject) o; return uuid.get().equals(that.uuid.get()); } 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> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GameObject that = (GameObject) o; return uuid.get().equals(that.uuid.get()); } 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; }