package com.mygdx.game;

import com.badlogic.gdx.graphics.Color;

public enum Planet {
    EARTH("Земля", 0.68f, 0.85f, 0.9f, 1.0f),
    MARS("Марс", 0.8f, 0.4f, 0.3f, 0.9f),
    VENUS("Венера", 1.0f, 0.7f, 0.4f, 1.0f);

    private final String name;
    private final float r, g, b, a;

    Planet(String name, float r, float g, float b, float a) {
        this.name = name;
        this.r = r;
        this.g = g;
        this.b = b;
        this.a = a;
    }

    public String getName() { return name; }
    public float getR() { return r; }
    public float getG() { return g; }
    public float getB() { return b; }
    public float getA() { return a; }

    public Color getColor() {
        return new Color(r, g, b, a);
    }

    public Planet next() {
        Planet[] planets = values();
        int nextIndex = (this.ordinal() + 1) % planets.length;
        return planets[nextIndex];
    }

    public Planet previous() {
        Planet[] planets = values();
        int prevIndex = (this.ordinal() - 1 + planets.length) % planets.length;
        return planets[prevIndex];
    }
}
