using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Sirenix.Utilities;
using UnityEditor;
using UnityEngine;
using VOID.Generic.Dict;
using VOID.Generic.Objects.Armor;

namespace Test.EditMode.Prefabs.Generic
{
    public class HelmetObjectTest
    {
        private List<GameObject> _gameObjects = new();

        [OneTimeSetUp]
        public void Setup()
        {
            AssetDatabase.FindAssets($"t:{nameof(GameObject)}").ForEach(gameObjectGuid =>
            {
                var gameObjectPath = AssetDatabase.GUIDToAssetPath(gameObjectGuid);
                var gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(gameObjectPath);
                var helmetObjects = gameObject.GetComponentsInChildren<ArmorObject>();
                
                // Only helmet for current testing
                if (helmetObjects.All(belt => belt.armorData.armorType != ArmorType.Helmet)) return;

                // If prefab have any ArmorObject - take it, we will test it
                if (helmetObjects.Length > 0) _gameObjects.Add(gameObject);
            });
        }

        [OneTimeTearDown]
        public void Cleanup()
        {
            _gameObjects?.Clear();
            _gameObjects = null;
        }

        [Test]
        public void NothingToTest()
        {
            
        }
    }
}

