public class CameraIntermediary extends Manager {

  @Wire
  private ComponentMapper<DimensionsComponent> dimensionsMapper;

  @Wire
  private HelixCamera camera;

  public void centerCameraOnArea() {
    Entity area = world.getManager(TagManager.class).getEntity("area");

    IntVector2 dimensions = dimensionsMapper.get(area).get();

    Vector3 position = camera.position;

    float zDirection = camera.direction.z;

    float yTranslation
        = (float) (Math.sqrt((1 - (zDirection * zDirection))) / zDirection) *
                  camera.position.z;

    camera.position.set(new Vector3(dimensions.x / 2,
                                    dimensions.y / 2 + yTranslation,
                                    position.z));
  }

} public class DisplayableIntermediary extends Manager {

  @Wire
  private AreaManager areaManager;

  @Wire
  private ComponentMapper<DisplayableComponent> displayableMapper;

  public void setAreaDisplayableOpacity(float value) {
    Entity area = areaManager.getArea();

    ((ModelDisplayable) displayableMapper.get(area).get()).updateOpacity(value);
  }

} public class CameraControlSystem extends VoidEntitySystem {
  
  private static final float FLAT_MOVEMENT_SPEED = 1;

  private static final float VERTICAL_MOVEMENT_STEP = 5;

  private static final int MAX_ZOOM_LEVEL = 3;

  private static final int MIN_ZOOM_LEVEL = -8;
  
  @Wire
  private HelixCamera camera;
  
  private Vector3 translation = new Vector3();

  private int zoomLevel;

  private ViewType currentView;

  @Override
  protected void initialize() {
    currentView = ViewType.PERSPECTIVE;
  }

  @Override
  protected void processSystem() {
    if (Gdx.input.isKeyPressed(Input.Keys.W)) {
      translation.y += 1;
    }

    if (Gdx.input.isKeyPressed(Input.Keys.D)) {
      translation.x += 1;
    }

    if (Gdx.input.isKeyPressed(Input.Keys.S)) {
      translation.y -= 1;
    }

    if (Gdx.input.isKeyPressed(Input.Keys.A)) {
      translation.x -= 1;
    }

    if (Gdx.input.isKeyJustPressed(Input.Keys.K) &&
        zoomLevel < MAX_ZOOM_LEVEL) {
      translation.z -= 1;

      zoomLevel++;
    }

    if (Gdx.input.isKeyJustPressed(Input.Keys.J) &&
        zoomLevel > MIN_ZOOM_LEVEL) {
      translation.z += 1;

      zoomLevel--;
    }

    camera.translate(translation.x * FLAT_MOVEMENT_SPEED,
        translation.y * FLAT_MOVEMENT_SPEED,
        translation.z * VERTICAL_MOVEMENT_STEP);

    translation.setZero();

    if (Gdx.input.isKeyJustPressed(Input.Keys.NUMPAD_1) &&
         currentView != ViewType.PERSPECTIVE) {
       camera.rotateAround(camera.position, new Vector3(1, 0, 0), 45);

       HelixEditor.getInstance().centerCameraOnAreaAction();

       currentView = ViewType.PERSPECTIVE;
     }

    if (Gdx.input.isKeyJustPressed(Input.Keys.NUMPAD_7) &&
        currentView != ViewType.TOP) {
      camera.rotateAround(camera.position, new Vector3(1, 0, 0), -45);

      HelixEditor.getInstance().centerCameraOnAreaAction();

      currentView = ViewType.TOP;
    }
  }

  public enum ViewType {
    PERSPECTIVE, TOP;
  }

} public class TileHighlightingSystem extends EntityProcessingSystem {

  @Wire
  private TagManager tagManager;

  @Wire
  private ComponentMapper<DisplayableComponent> displayableMapper;

  @Wire
  private ComponentMapper<TilesComponent> tilesMapper;

  @Wire
  private HelixCamera camera;

  private Tile highlightedTile;

  @SuppressWarnings("unchecked")
  public TileHighlightingSystem() {
    super(Aspect.getAspectForAll(TilesComponent.class,
                                 DimensionsComponent.class));
  }

  @Override
  protected void initialize() {
    Entity highlight = world.createEntity()
                            .edit()
                            .add(new PositionComponent())
                            .add(new DimensionsComponent(new IntVector2(1, 1)))
                            .add(new DisplayableComponent(
                                new TileHighlightDisplayable()))
                            .getEntity();
    world.getManager(TagManager.class).register("tileHighlight", highlight);
  }

  @Override
  protected void process(Entity e) {
    if (!mouseMoved()) {
      return;
    }

    Entity highlight = tagManager.getEntity("tileHighlight");

    Tile[][] tiles = tilesMapper.get(e).get();

    Ray ray = camera.getPickRay(Gdx.input.getX(), Gdx.input.getY());

    boolean hovering = false;

    for (int y = 0; y < tiles.length; y++) {
      for (int x = 0; x < tiles[y].length; x++) {
        BoundingBox boundingBox = new BoundingBox(new Vector3(0, 0, 0),
                                                  new Vector3(1, 1, 0));

        Matrix4 transformation = new Matrix4();
        transformation.translate(new Vector3(x, y, 0));

        boundingBox.mul(transformation);

        if (Intersector.intersectRayBoundsFast(ray, boundingBox)) {
         if (tiles[y][x] != highlightedTile) {
           // FIXME
//            ModelDisplayable highlightDisplayable
//                = (ModelDisplayable) displayableMapper.get(highlight).get();
//            highlightDisplayable.updateTranslation(new Vector3(x, y, 0));

//            highlight.edit().create(VisibilityComponent.class);

            highlightedTile = tiles[y][x];
          }

          hovering = true;

          break;
        }
      }
    }

    if (!hovering) {
      highlightedTile = null;

      highlight.edit().remove(VisibilityComponent.class);
    }
  }

  private boolean mouseMoved() {
    return Gdx.input.getDeltaX() != 0 || Gdx.input.getDeltaY() != 0;
  }

  public Tile getHighlightedTile() {
    return highlightedTile;
  }

} public class TilePermissionsEditingSystem extends EntityProcessingSystem {

  private static final String atlasPath = "texture-atlas/tile-permissions.atlas";

  @Wire
  private AreaManager areaManager;

  @Wire
  private TagManager tagManager;

  @Wire
  private ComponentMapper<DimensionsComponent> dimensionsMapper;

  @Wire
  private ComponentMapper<DisplayableComponent> displayableMapper;

  @Wire
  private ComponentMapper<TilesComponent> tilesMapper;

  @Wire
  private TileHighlightingSystem tileHighlightingSystem;

  @Wire
  private AssetManager assetManager;

  private Tile highlightedTile;

  private Tile lastUpdatedTile;

  private boolean running;

  @SuppressWarnings("unchecked")
  public TilePermissionsEditingSystem() {
    super(Aspect.getAspectForAll(TilesComponent.class));
  }

  @Override
  protected void initialize() {
    HelixEditor.getInstance().getWorldEventBus().register(this);

    areaManager = world.getManager(AreaManager.class);
    tagManager = world.getManager(TagManager.class);

    assetManager.load(atlasPath, TextureAtlas.class);
    assetManager.finishLoading();
  }

  private void createGrid() {
    Entity area = areaManager.getArea();

    Entity grid = world.createEntity()
        .edit()
        .add(new DimensionsComponent(dimensionsMapper.get(area).get()))
        .add(new DisplayableComponent(
            new TilePermissionsGridDisplayable(
                tilesMapper.get(area).get(),
                assetManager.get(atlasPath, TextureAtlas.class))))
        .add(new VisibilityComponent())
        .getEntity();

    tagManager.register("tilePermissionsGrid", grid);
  }

  @Override
  protected void process(Entity e) {
    Tile highlightedTile = tileHighlightingSystem.getHighlightedTile();

    if (highlightedTile != this.highlightedTile) {
      this.highlightedTile = highlightedTile;
    }

    if (lastUpdatedTile != highlightedTile &&
        highlightedTile != null &&
        Gdx.input.isButtonPressed(Input.Buttons.LEFT)) {
      Entity area = areaManager.getArea();

      Tile[][] tiles = tilesMapper.get(area).get();

      for (int y = 0; y < tiles.length; y++) {
        for (int x = 0; x < tiles[y].length; x++) {
          Tile tile = tiles[y][x];

          if (tile == highlightedTile) {
            HelixEditor editor = HelixEditor.getInstance();

            TilePermission selectedTilePermission
                = editor.getTilePermissionListState().getSelected();
            tile.setPermissions(selectedTilePermission);

            if (selectedTilePermission == TilePermission.PASSAGE) {
              String selectedAreaName
                  = editor.getTilePassageAreaListState().getSelected();

              IntVector2 targetPosition
                  = editor.getTilePassageTargetPositionFieldState()
                          .getPosition();

              tile.setAreaPassage(
                  new TileAreaPassage(selectedAreaName, targetPosition));
            }

            HashMap<Integer, Tile> updatedTilesWithIndex = new HashMap<>();
            updatedTilesWithIndex.put(x + y * tiles.length, tile);

            Entity grid = tagManager.getEntity("tilePermissionsGrid");

            TilePermissionsGridDisplayable gridDisplayable
                = (TilePermissionsGridDisplayable)
                    displayableMapper.get(grid).get();
            gridDisplayable.updateTiles(updatedTilesWithIndex);

            lastUpdatedTile = tile;

            break;
          }
        }
      }
    }
  }

  @Override
  public boolean checkProcessing() {
    return running;
  }

  @Subscribe
  public void areaLodaded(AreaLoadedEvent e) {
    createGrid();

    running = true;
  }

  @Subscribe
  public void areaUnloaded(AreaUnloadedEvent e) {
    running = false;

    tagManager.getEntity("tilePermissionsGrid").deleteFromWorld();
  }

} public class HelixCamera extends PerspectiveCamera {

  private static final Vector3 INITIAL_POSITION;

  private static final float POSITION_Y_TO_Z_RATIO;

  private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;

  private Vector3 targetPosition;

  private Vector3 targetPositionDelta;

  static {
    INITIAL_POSITION = new Vector3(0, -13, 17);
    POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
    DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
  }

  public HelixCamera(float fieldOfView,
                     Vector3 targetPosition,
                     float near,
                     float far) {
    super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

    this.targetPosition = new Vector3();
    this.near = near;
    this.far = far;
    this.translate(0, -13, 17);
    this.lookAt(0, 0, 0);

    targetPositionDelta = new Vector3();

    translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
  }

  public void translateTargetPosition(Vector3 translation) {
    translateTargetPosition(translation.x, translation.y, translation.z);
  }

  public void translateTargetPosition(float x, float y, float z) {
    super.translate(x, y, z);

    targetPosition.add(x, y, z);
    targetPositionDelta.set(x, y, z);
  }

  public void updateTargetPosition(IntVector3 logicalPosition) {
    Vector3 translation
        = logicalPosition.cpy().toVector3()
                         .add(DEFAULT_TARGET_DISPLACEMENT)
                         .sub(targetPosition);

    translateTargetPosition(translation);
  }

  public Vector3 getTargetPositionDelta() {
    return targetPositionDelta;
  }

  public void resetPositionDelta() {
    targetPositionDelta.setZero();
  }

} public class AreaManager extends Manager {

  @Wire
  private ComponentMapper<AreaTypeComponent> areaTypeMapper;

  @Wire
  private ComponentMapper<DimensionsComponent> dimensionsMapper;

  @Wire
  private ComponentMapper<DisplayableComponent> displayableMapper;

  @Wire
  private ComponentMapper<NameComponent> nameMapper;

  @Wire
  private ComponentMapper<TilesComponent> tilesMapper;

  @Wire
  private AssetManager assetManager;

  private Entity area;

  // FIXME: Add area type
  public void create(String name, int width, int length) {
    Json json = new Json();

    IntVector2 dimensions = new IntVector2(width, length);

    FileHandle file = Gdx.files.internal("area/" + name + ".json");

    try {
      json.setWriter(new JsonWriter(new FileWriter(file.file())));
    } catch (IOException e) {
      e.printStackTrace();
    }

    json.writeObjectStart();
    json.writeValue("width", dimensions.x);
    json.writeValue("length", dimensions.y);
    json.writeArrayStart("tiles");
    for (int y = 0; y < dimensions.y; y++) {
      for (int x = 0; x < dimensions.x; x++) {
        json.writeObjectStart();
        json.writeValue("permissions", TilePermission.LEVEL0.toString());
        json.writeObjectEnd();
      }
    }
    json.writeArrayEnd();
    json.writeObjectEnd();

    try {
      json.getWriter().close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  public void load(String name) {
    loadFromFile(Gdx.files.internal("area/" + name + ".json"), name);
  }
  
  public void loadFromFile(FileHandle file, String name) {
    Json json = new Json();
    json.setIgnoreUnknownFields(true);

    AreaWrapper areaWrapper = json.fromJson(AreaWrapper.class, file);

    Tile[][] tiles = new Tile[areaWrapper.length][areaWrapper.width];
    int i = 0;
    for (TileWrapper wrapper : areaWrapper.tiles) {
      Tile tile = new Tile();

      tile.setPermissions(wrapper.permissions);

      if (wrapper.passage != null) {
        TileAreaPassage areaPassage = new TileAreaPassage();

        areaPassage.setTargetAreaName(wrapper.passage.area);
        areaPassage.setTargetCoords(
            new IntVector2(wrapper.passage.position.x,
                wrapper.passage.position.y));

        tile.setAreaPassage(areaPassage);
      }

      tiles[i / areaWrapper.width][i % areaWrapper.width] = tile;

      i++;
    }

    String modelPath = "model/" + name + ".g3db";

    assetManager.load(modelPath, Model.class);
    assetManager.finishLoading();

    Model model = assetManager.get(modelPath, Model.class);
    for (Material m : model.materials) {
      m.set(new FloatAttribute(FloatAttribute.AlphaTest, 0.1f));
    }

    Entity area = world.createEntity()
                       .edit()
                       .add(new AreaTypeComponent(areaWrapper.type))
                       .add(new TilesComponent(tiles))
                       .add(new DimensionsComponent(
                           new IntVector2(areaWrapper.width,
                                          areaWrapper.length)))
                       .add(new NameComponent(name))
                       .add(new DisplayableComponent(new AreaDisplayable(model)))
                       .add(new VisibilityComponent())
                       .getEntity();
    world.getManager(TagManager.class).register("area", area);

    this.area = area;
  }

  // FIXME: Add area type
  public void save() {
    Json json = new Json();

    String name = nameMapper.get(area).get();

    FileHandle file = Gdx.files.internal("area/" + name + ".json");

    IntVector2 dimensions = dimensionsMapper.get(area).get();

    AreaType type = areaTypeMapper.get(area).get();

    try {
      json.setWriter(new JsonWriter(new FileWriter(file.file())));
    } catch (IOException e) {
      e.printStackTrace();
    }

    json.writeObjectStart();
    json.writeValue("width", dimensions.x);
    json.writeValue("length", dimensions.y);
    json.writeValue("type", type);
    json.writeArrayStart("tiles");
    Tile[][] tiles = tilesMapper.get(area).get();
    for (int y = 0; y < dimensions.y; y++) {
      for (int x = 0; x < dimensions.x; x++) {
        Tile tile = tiles[y][x];

        json.writeObjectStart();

        json.writeValue("permissions", tile.getPermissions().toString());

        if (tile.getAreaPassage() != null) {
          TileAreaPassage passage = tile.getAreaPassage();

          json.writeObjectStart("passage");

          json.writeValue("area", passage.getTargetAreaName());

          json.writeObjectStart("position");
          json.writeValue("x", passage.getTargetCoords().x);
          json.writeValue("y", passage.getTargetCoords().y);
          json.writeObjectEnd();

          json.writeObjectEnd();
        }

        json.writeObjectEnd();
      }
    }
    json.writeArrayEnd();
    json.writeObjectEnd();

    try {
      json.getWriter().close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
  
  public void unloadCurrent() {
    if (area != null) {
      area.deleteFromWorld();

      area = null;
    }
  }

  public static String constructPassageAnimationId(IntVector2 passageCoords,
                                                   PassageAction action) {
    return "passage-" +
           action.toString().toLowerCase() +
           "-" + String.valueOf(passageCoords.x) +
           "-" + String.valueOf(passageCoords.y);
  }

  public boolean isAreaLoaded() {
    return area != null;
  }

  public Entity getArea() {
    return area;
  }

  public Array<String> getAllNames() {
    Array<String> names = new Array<String>();

    FileHandle directory = Gdx.files.internal("area");

    for (FileHandle entry : directory.list()) {
      if (entry.extension().equalsIgnoreCase("json")) {
        names.add(entry.nameWithoutExtension());
      }
    }

    return names;
  }

} public class LocalAmbienceManager extends Manager {

  private Ambience ambience;

  @Override
  public void initialize() {
    ambience = new Ambience();
  }

  public Ambience getAmbience() {
    return ambience;
  }

  public void setAmbience(Ambience ambience) {
    this.ambience = ambience;
  }

} public class TextureManager extends Manager {

  public static final String DIRECTORY_NAME = "texture-set";
  
  public static final String EXTENSION = "atlas";

  @Wire
  private AssetManager assetManager;
  
  private TextureAtlas textureSet;
  
  public TextureManager() { }
  
  public void loadSet(String name) {
    String path = DIRECTORY_NAME + "/" + name + "." + EXTENSION;

    assetManager.load(path, TextureAtlas.class);
    assetManager.finishLoading();

    textureSet = assetManager.get(path);
  }
    
  public TextureAtlas getTextureSet() {
    return textureSet;
  }

} public class WeatherMan extends Manager {

  private Ambience weather;

  public void initialize() {
    setDefault();
  }

  public void setDefault() {
    weather = new Ambience();
  }

  public void setToType(WeatherType type) {
    Environment environment = new Environment();
    Bloom bloom = null;
    ParticleEffect precipitationEffect = null;

    switch (type) {
      case NONE:
        environment.set(
            new ColorAttribute(ColorAttribute.AmbientLight, 1, 1, 1, 1));
        break;
      case SUNNY:
        bloom = new Bloom();
        bloom.setBloomIntesity(1.1f);
        bloom.setOriginalIntesity(1);

        environment.set(
            new ColorAttribute(ColorAttribute.AmbientLight, 1, 1, 1, 1));
        break;
      case OVERCAST:
        bloom = new Bloom();
        bloom.setBloomIntesity(.6f);
        bloom.setOriginalIntesity(.8f);

        environment.set(
            new ColorAttribute(ColorAttribute.AmbientLight, .8f, .8f, .8f, 1));
        break;
      case RAINSTORM:
        bloom = new Bloom();
        bloom.setBloomIntesity(.2f);
        bloom.setOriginalIntesity(.2f);

        environment.set(
            new ColorAttribute(ColorAttribute.AmbientLight, .5f, .5f, .6f, 1));
        environment.set(
            new ColorAttribute(ColorAttribute.Fog, 1, 1, 1, 1));

        precipitationEffect = new ParticleEffect();
        precipitationEffect.load(
            Gdx.files.internal("effect/rain.p"), Gdx.files.internal("effect"));
        precipitationEffect.setPosition(Gdx.graphics.getWidth() / 2,
                                        Gdx.graphics.getHeight() / 2);
        precipitationEffect.start();
        break;
      default: throw new IllegalStateException();
    }

    weather.setEnvironment(environment);
    weather.setBloom(bloom);
    weather.setParticleEffect(precipitationEffect);
  }

  public Ambience getWeather() {
    return weather;
  }

  public enum WeatherType {
    NONE, SUNNY, OVERCAST, RAINSTORM;
  }

} public class RenderingSystem extends EntitySystem {

  @Wire
  private LocalAmbienceManager localAmbienceManager;

  @Wire
  private ComponentMapper<DisplayableComponent> displayableMapper;
  
  @Wire
  private HelixCamera camera;
  
  private Array<ModelDisplayable> modelDisplayables;

  private Array<DecalDisplayable> decalDisplayables;

  private Array<Array<? extends Displayable>> displayableCollections;
  
  private RenderContext renderContext;

  private ModelBatch modelBatch;

  private DecalBatch decalBatch;

  private SpriteBatch spriteBatch;

  @SuppressWarnings("unchecked")
  public RenderingSystem() {
    super(Aspect.getAspectForAll(DisplayableComponent.class,
                                 VisibilityComponent.class));
  }
  
  @Override
  protected void initialize() {
    displayableCollections = new Array<Array<? extends Displayable>>();

    modelDisplayables = new Array<ModelDisplayable>();
    displayableCollections.add(modelDisplayables);

    decalDisplayables = new Array<DecalDisplayable>();
    displayableCollections.add(decalDisplayables);

    renderContext = new RenderContext(
        new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED));
    renderContext.setCullFace(GL20.GL_BACK);

    modelBatch = new ModelBatch(renderContext,
                                new DefaultShaderProvider(),
                                new HelixRenderableSorter());

    decalBatch = new DecalBatch(new CameraGroupStrategy(camera));

    spriteBatch = new SpriteBatch();
  }

  @Override
  protected void processEntities(IntBag entities) {
    camera.update();

    Ambience ambience = localAmbienceManager.getAmbience();
    Bloom bloom = ambience.getBloom();
    ParticleEffect particleEffect = ambience.getParticleEffect();

    GL20 gl = Gdx.graphics.getGL20();

    gl.glClearColor(0, 0, 0, 1);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);

    if (bloom != null) {
      bloom.capture();
    }

    renderContext.begin();
    modelBatch.begin(camera);

    modelBatch.render(modelDisplayables, ambience.getEnvironment());

    modelBatch.end();
    renderContext.end();

    for (DecalDisplayable displayable : decalDisplayables) {
      for (Decal d : displayable.getDecals()) {
        decalBatch.add(d);
      }
    }

    decalBatch.flush();

    spriteBatch.begin();
    if (particleEffect != null) {
      particleEffect.draw(spriteBatch, Gdx.graphics.getDeltaTime());
    }
    spriteBatch.end();

    if (bloom != null) {
      bloom.render();
    }
  }
  
  @Override
  protected void inserted(Entity e) {
    Displayable displayable = displayableMapper.get(e).get();

    if (displayable instanceof ModelDisplayable) {
      modelDisplayables.add((ModelDisplayable) displayable);
    } else if (displayable instanceof DecalDisplayable) {
      decalDisplayables.add((DecalDisplayable) displayable);
    }
  }
  
  @Override
  protected void removed(Entity e) {
    Displayable displayableToRemove = displayableMapper.get(e).get();

    for (Array<? extends Displayable> displayableCollection : displayableCollections) {
      Iterator<? extends Displayable> it = displayableCollection.iterator();

      while (it.hasNext()) {
        if (it.next().equals(displayableToRemove)) {
          it.remove();
        }
      }
    }
  }

}
import com.artemis.World;
import com.artemis.WorldConfiguration;
import com.artemis.managers.GroupManager;
import com.artemis.managers.TagManager;
import com.artemis.managers.UuidEntityManager;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.editor.manager.CameraIntermediary;
import com.github.fauu.helix.editor.manager.DisplayableIntermediary;
import com.github.fauu.helix.editor.system.CameraControlSystem;
import com.github.fauu.helix.editor.system.TileHighlightingSystem;
import com.github.fauu.helix.editor.system.TilePermissionsEditingSystem;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.manager.AreaManager;
import com.github.fauu.helix.manager.LocalAmbienceManager;
import com.github.fauu.helix.manager.TextureManager;
import com.github.fauu.helix.manager.WeatherMan;
import com.github.fauu.helix.system.RenderingSystem;
/*
 * Copyright (C) 2014-2016 Helix Engine Developers 
 * (http://github.com/fauu/HelixEngine)
 *
 * This software is licensed under the GNU General Public License
 * (version 3 or later). See the COPYING file in this distribution.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this software. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by: Piotr Grabowski <fau999@gmail.com>
 */

package com.github.fauu.helix.editor.screen;


public class Overworld implements Screen {

  private World world;

  private HelixCamera camera;

  private AssetManager assetManager;

  private DisplayableIntermediary displayableIntermediary;

  private CameraIntermediary cameraIntermediary;

  public Overworld() {
    assetManager = new AssetManager();

    camera = new HelixCamera(60, new Vector3(0, -30, 30), .01f, 300);

    WorldConfiguration worldConfiguration 
        = new WorldConfiguration().register(assetManager)
                                  .register(camera);
    world = new World(worldConfiguration);

    world.setManager(new UuidEntityManager());
    world.setManager(new TextureManager());