All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.janno.evaluator.dice.RollId Maven / Gradle / Ivy

The newest version!
package de.janno.evaluator.dice;

import lombok.NonNull;
import lombok.Value;


@Value(staticConstructor = "of")
public class RollId implements Comparable {
    @NonNull
    ExpressionPosition expressionPosition;
    int reevaluate;

    @Override
    public String toString() {
        return expressionPosition + "e" + reevaluate;
    }

    @Override
    public int compareTo(RollId o) {
        if (!expressionPosition.equals(o.expressionPosition)) {
            return expressionPosition.compareTo(o.expressionPosition);
        }
        return Integer.compare(reevaluate, o.reevaluate);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy