/*
 * Copyright 2014-2015 See AUTHORS file.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.kotcrab.vis.runtime.util;

import com.artemis.SystemInvocationStrategy;
import com.artemis.World;

/**
 * Extends Artemis {@link World}. Does not provide any additional methods, exists because Artemis World duplicated box2d World class.
 * @author Kotcrab
 */
public class EntityEngine extends World {
	public EntityEngine (EntityEngineConfiguration configuration) {
		super(configuration.build());
	}

	@Override
	public void setInvocationStrategy (SystemInvocationStrategy invocationStrategy) {
		super.setInvocationStrategy(invocationStrategy);
	}
}

@@ -658,56 +658,180 @@
 mis.
-SystemInvocationStrategy;%0Aimport com.artemis.Wor
+Entity;%0Aimport com.artemis.EntityManager;%0Aimport com.artemis.SystemInvocationStrategy;%0Aimport com.artemis.World;%0Aimport com.artemis.utils.Bag;%0A%0Aimport java.lang.reflect.Fie
 ld;%0A
@@ -1034,16 +1034,49 @@
 World %7B%0A
+%0A%09private Bag%3CEntity%3E entities;%0A%0A
 %09public 
@@ -1163,16 +1163,566 @@
 uild());
+%0A%0A%09%09//FIXME: this must be removed ASAP when artemis is fixed%0A%09%09//https://github.com/junkdog/artemis-odb/issues/347%0A%09%09try %7B%0A%09%09%09Field entitiesField = EntityManager.class.getDeclaredField(%22entities%22);%0A%09%09%09entitiesField.setAccessible(true);%0A%09%09%09entities = (Bag%3CEntity%3E) entitiesField.get(getEntityManager());%0A%09%09%7D catch (ReflectiveOperationException e) %7B%0A%09%09%09throw new IllegalStateException(e);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public Entity getEntity (int entityId) %7B%0A%09%09Entity e = entities.safeGet(entityId);%0A%09%09if(e != null) return e;%0A%09%09return super.getEntity(entityId);
 %0A%09%7D%0A%0A%09@O

Add workaround for Artemis issue