#pragma once

#include <string>
#include <vector>

struct GameConfig;
struct RecipeDef;
class Simulation;

// Where an item comes from, as far as the player has discovered (REQ-UI-ITEM-TOOLTIP).
enum class ItemOrigin
{
    Produced,      // at least one recipe the player can run makes it
    Undiscovered,  // recipes make it, but none of them is available yet
    Salvaged,      // no recipe makes it at all -- scrap, which comes from debris
};

struct ItemProduction
{
    ItemOrigin                    origin = ItemOrigin::Salvaged;
    // The available producers, in config order. Empty unless origin is Produced.
    std::vector<const RecipeDef*> recipes;
};

// Every way the player can currently produce the given item, for the tooltip that
// explains an item chip (REQ-UI-ITEM-TOOLTIP).
//
// A producer counts as available when the player can run the recipe (REQ-LOCK-UI-RECIPE)
// and can place the building that runs it (REQ-LOCK-BUILDING) -- there is no sense in
// naming a path through a plant they cannot build.
ItemProduction findItemProduction(const std::string& itemId, const Simulation& sim,
                                  const GameConfig& config);
