using System.Collections.Generic;
using System.Linq;
using UnityEngine;

public sealed class EconomyParameters
{
    public readonly Dictionary<string, int> ResourceCost;
    public readonly ModifierParam[] Modifiers;
    public readonly string[] ResourceIds;
    public readonly EquipmentBlueptints Blueprints;
    public readonly int FuelCost = 2;

    public EconomyParameters(
        Dictionary<string, int> resourcesCost,
        EquipmentBlueptints blueprints,
        ModifierParam[] modifiers,
        int fuelCost)
    {
        ResourceCost = resourcesCost;
        ResourceIds = resourcesCost.Keys.ToArray();
        Modifiers = modifiers;
        Blueprints = blueprints;
        FuelCost = fuelCost;
    }

    public int GetBaseCost(string resourceId)
    {
        if (ResourceCost.TryGetValue(resourceId, out var cost))
            return cost;
        Debug.LogError($"can't find base cost for {resourceId}");
        return 100;
    }
}
