package de.siphalor.was.game;

import org.jetbrains.annotations.NotNull;

import java.util.Locale;

public class Transaction {
	private final Type type;
	private final int change;
	private final String productKey;

	public Transaction(@NotNull Type type, int change, @NotNull String productKey) {
		this.type = type;
		this.change = change;
		this.productKey = productKey;
	}

	@NotNull
	public Type getType() {
		return type;
	}

	public int getChange() {
		return change;
	}

	@NotNull
	public String getProductKey() {
		return productKey;
	}

	public enum Type {
		ABANDON, DESTROY, MOVE, NOOP, DELIVER, STORE;

		public String getTranslationKey() {
			return "game.balance.history.type." + name().toLowerCase(Locale.ENGLISH);
		}
	}
}
