#include "adapters/config/ItemConfigAdapter.h"

#include "foundation/text/StringUtils.h"

namespace ta::adapters::config
{
    ItemConfigAdapter::ItemConfigAdapter()
        : ta::application::config::ConfigOwner("item", "Item", ta::application::config::ConfigCategory::ItemList)
    {
    }

    ta::features::items::contracts::ItemSettings ItemConfigAdapter::read() const
    {
        return {
            ta::foundation::text::trim_copy(item_id_->get()),
            item_slot_->get_value(),
            override_max_amount_->get_value(),
            amount_->get_value(),
            fir_->get_value(),
            item_slot_->get_value() == ta::features::items::contracts::quest_item_inventory_slot_index
                ? false
                : overwrite_slot_->get_value(),
            no_slot_limits_->get_value(),
            increased_transfer_size_->get_value()
        };
    }

}
