package com.kehxstudios.atlas.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.kehxstudios.atlas.data.ComponentData;
import com.kehxstudios.atlas.components.GraphicsComponent;
import com.kehxstudios.atlas.tools.Factory;
import com.kehxstudios.atlas.tools.Templates;
import com.kehxstudios.atlas.type.TextureType;
import com.kehxstudios.atlas.entities.Entity;
import com.kehxstudios.atlas.data.EntityData;
import com.kehxstudios.atlas.managers.GameManager;
import com.kehxstudios.atlas.data.HighScores;

/**
 * Created by ReidC on 2017-04-07.
 */

public abstract class AScreen implements Screen {

    protected GameManager gm;
    protected com.kehxstudios.atlas.type.ScreenType type;
    protected float width, height;

    protected Entity screenEntity;
    protected GraphicsComponent screenGraphics;

    protected float screenTime;
    protected HighScores highScores;
    protected int score;

    public AScreen(com.kehxstudios.atlas.type.ScreenType type) {
        this.type = type;
        gm = GameManager.getInstance();
        width = type.getWidth();
        height = type.getHeight();
        highScores = new HighScores(type);
        screenTime = 0;
        score = 0;

        EntityData entityData = Templates.createEntityData(width/2, height/2);
        screenEntity = Factory.createEntity(entityData);

        ComponentData graphicsData = Templates.createGraphicsComponentData(0, 0, 1, TextureType.VOID);
        screenGraphics = (GraphicsComponent)Factory.createComponent(screenEntity, graphicsData);

        GameManager.getInstance().getCamera().setToOrtho(false, width, height);
        GameManager.getInstance().getCamera().update();
    }

    @Override
    public void render(float delta) {
        screenTime += delta;
    }

    @Override
    public void dispose() {
        highScores.dispose();
    }

    public float getScaleWidth() {
        return Gdx.graphics.getWidth();
    }

    public float getScaleHeight() {
        return Gdx.graphics.getHeight();
    }

    public float getWidth() { return width; }

    public float getHeight() { return height; }

    public int getScore() { return score; }

    public void addScore(int value) { score += value; }

    public void setScore(int score) { this.score = score; }
}

@@ -540,16 +540,63 @@
 Scores;%0D
+%0Aimport com.kehxstudios.atlas.type.ScreenType;%0D
 %0A%0D%0A/**%0D%0A
@@ -740,35 +740,8 @@
 ted 
-com.kehxstudios.atlas.type.
 Scre
@@ -1285,32 +1285,44 @@
     
-EntityData entityData = 
+screenEntity = Factory.createEntity(
 Temp
@@ -1362,17 +1362,20 @@
 eight/2)
-;
+);%0D%0A
 %0D%0A      
@@ -1386,291 +1386,176 @@
 reen
-Entity = Factory.createEntity(entityData);%0D%0A%0D%0A        ComponentData graphicsData = Templates.createGraphicsComponentData(0, 0, 1, TextureType.VOID);%0D%0A        screenGraphics = (GraphicsComponent)Factory.createComponent(screenEntity, graphicsData);%0D%0A%0D%0A        GameManager.getInstance()
+Graphics = (GraphicsComponent)Factory.createComponent(screenEntity, %0D%0A                  Templates.createGraphicsComponentData(0, 0, 1, TextureType.VOID));%0D%0A%0D%0A        gm
 .get
@@ -1610,33 +1610,10 @@
     
-GameManager.getInstance()
+gm
 .get
@@ -1838,21 +1838,24 @@
 loat get
-Scale
+Graphics
 Width() 
@@ -1931,13 +1931,16 @@
  get
-Scale
+Graphics
 Heig

Update AScreen.java