using Engine.Scene;
using Engine.Scene.Component.BuiltIn;

namespace DoomDeathmatch;

public static class GameObjectUtil
{
  public static GameObject CreateGameObject(Engine.Scene.Scene parScene,
    List<Engine.Scene.Component.Component> parComponents)
  {
    var gameObject = new GameObject();
    foreach (var component in parComponents)
    {
      gameObject.AddComponent(component);
    }

    parScene.Add(gameObject);

    return gameObject;
  }

  public static GameObject CreateGameObject(Engine.Scene.Scene parScene, Transform parTransform,
    List<Engine.Scene.Component.Component> parComponents)
  {
    var gameObject = new GameObject(parTransform);
    foreach (var component in parComponents)
    {
      gameObject.AddComponent(component);
    }

    parScene.Add(gameObject);

    return gameObject;
  }
}