package de.siphalor.was.content.quest;

import de.siphalor.was.WhatAStorage;
import de.siphalor.was.content.product.Product;

import java.util.Random;

public class RandomQuestGenerator implements QuestGenerator {
	private static final Random RANDOM = new Random();
	@Override
	public void restart() {

	}

	@Override
	public boolean hasMoreElements() {
		return true;
	}

	@Override
	public Quest nextElement() {
		Product product = WhatAStorage.getInstance().getProductManager().randomProduct(RANDOM);
		return new Quest(
				RANDOM.nextBoolean() ? Quest.Type.IN : Quest.Type.OUT,
				RANDOM.nextInt(15) * 100 * product.getDepth(),
				product
		);
	}
}
