require "Items/Distributions";
require "Items/ProceduralDistributions";
local magazines_items = {"AutoTurret.StandTurretBook", 1, "AutoTurret.BeginnerTurretBook", 0.8,
                         "AutoTurret.TacticalTurretBook", 0.3, "AutoTurret.MoveableTurretBook", 0.4,
                         "AutoTurret.MediumTurretBook", 0.5, "AutoTurret.HeavyTurretBook", 0.3,
                         "AutoTurret.TurretAmmoBook", 1};

local function insertItemListsInProcDistribution(location, itemDistList)
    local debugfactor = 1;
    local table = ProceduralDistributions["list"][location].items
    if (table == nil) then
        print("ERROR: ProceduralDistributions[\"list\"][\"" .. location .. "\"].items is nil")
        return
    end
    local n = #table
    for idx, itemDist in ipairs(itemDistList) do
        for i = 1, #itemDist do
            n = n + 1
            table[n] = itemDist[i]
        end
    end
end

insertItemListsInProcDistribution("CrateMagazines", {magazines_items});
insertItemListsInProcDistribution("MagazineRackMixed", {magazines_items});
insertItemListsInProcDistribution("MagazineRackMaps", {magazines_items});
insertItemListsInProcDistribution("MagazineRackNewspaper", {magazines_items});
insertItemListsInProcDistribution("CrateElectronics", {magazines_items});
insertItemListsInProcDistribution("GarageTools", {magazines_items});
insertItemListsInProcDistribution("LibraryBooks", {magazines_items});
insertItemListsInProcDistribution("LibraryCounter", {magazines_items});
insertItemListsInProcDistribution("BookstoreBooks", {magazines_items});
insertItemListsInProcDistribution("LivingRoomShelf", {magazines_items});
insertItemListsInProcDistribution("PostOfficeBooks", {magazines_items});
insertItemListsInProcDistribution("CrateBooks", {magazines_items});
insertItemListsInProcDistribution("KitchenBook", {magazines_items});
