package model.automata;

import javafx.scene.paint.Color;
import model.State;

import java.util.List;

/**
 * {@link GameOfLifeState} instances represent the possible states of a {@link GameOfLifeState}.
 */
public enum GameOfLifeState implements State<GameOfLifeState> {
    ALIVE, DEAD;


    @Override
    public Color getColor() {
        return this == ALIVE ? Color.RED : Color.WHITE;
    }

    @Override
    public GameOfLifeState next() {
        switch (this) {
            case ALIVE:
                return DEAD;
                case DEAD:
                    return ALIVE;
                    default:
                        return ALIVE;
        }
    }

    @Override
    public GameOfLifeState update(List<GameOfLifeState> neighbours) {
        //TODO: à compléter
        return null;
    }

}