package de.frajul.endlessroll.levels;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;

/**
 * Created by Julian on 07.12.2015.
 */
public class ObstacleData {

    @Attribute
    private boolean floating;
    @Attribute
    private boolean moving;
    @Attribute
    private boolean deadly;
    @Attribute
    private float leftEdge;
    @Attribute
    private float rightEdge;
    @Attribute
    private float height;
    @Attribute
    private float y;
    @Element(required = false)
    private MoveComponent moveComponent;

    public boolean isFloating() {
        return floating;
    }

    public boolean isMoving() {
        return moving;
    }

    public boolean isDeadly() {
        return deadly;
    }

    public float getX() {
        return leftEdge + getWidth() / 2;
    }

    public float getWidth() {
        return rightEdge - leftEdge;
    }

    public float getHeight() {
        return height;
    }

    public float getY() {
        return y;
    }

    public MoveComponent getMoveComponent() {
        return moveComponent;
    }


    //Only for glTestScreen
    public void setFloating(boolean floating) {
        this.floating = floating;
    }

    public void setMoving(boolean moving) {
        this.moving = moving;
    }

    public void setDeadly(boolean deadly) {
        this.deadly = deadly;
    }

    public void setLeftEdge(float leftEdge) {
        this.leftEdge = leftEdge;
    }

    public void setRightEdge(float rightEdge) {
        this.rightEdge = rightEdge;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    public void setY(float y) {
        this.y = y;
    }

    public void setMoveComponent(MoveComponent moveComponent) {
        this.moveComponent = moveComponent;
    }
}
