package de.siphalor.was.visual;

import de.siphalor.was.WhatAStorage;
import de.siphalor.was.content.product.Product;
import de.siphalor.was.content.quest.Quest;
import de.siphalor.was.game.Transaction;

/**
 * An interface for handling the display.
 */
public interface Visual {
	/**
	 * Called in the setup stage of the application.
	 * @param whatAStorage The main instance of the game
	 */
	void setup(WhatAStorage whatAStorage);

	/**
	 * Starts the display and hands over control to this method.
	 */
	void run();

	/**
	 * Called when a game starts.
	 * @param width The storage width
	 * @param height The storage height
	 * @param depth The storage depth
	 */
	void onGameStart(int width, int height, int depth);

	/**
	 * Called when the a program stop got requested.
	 */
	void onScheduleStop();

	/**
	 * Called when the localization changed. Should reload all of the localized UIs.
	 */
	void invalidateI18n();

	/**
	 * Called when a transactions gets added.
	 * @param budget The new budget
	 * @param transaction The new transaction
	 * @param totalIncome The total income
	 * @param totalLoss The total loss
	 */
	void onBalanceChanged(int budget, Transaction transaction, int totalIncome, int totalLoss);

	/**
	 * Called when a quest gets added.
	 * @param newQuest The new quest
	 * @param canCreateMore Whether the user can request more quests
	 */
	void onQuestAdded(Quest newQuest, boolean canCreateMore);

	/**
	 * Called when a quest gets fulfilled or abandoned.
	 * @param index The index of the quest to remove
	 */
	void onQuestRemoved(int index);

	void onProductSet(int x, int y, int z, Product product);

	void onProductCleared(int x, int y, int z, Product product);
}
