using Darkmatter.Core.Enums.Services.Audio;
using UnityEngine;

namespace Darkmatter.Core.Data.Dynamic.Services.Audio
{
    public readonly struct AudioRequest
    {
        public readonly AudioClip Clip;
        public readonly AudioChannel Channel;
        public readonly AudioPlayMode PlayMode;
        public readonly bool StopChannelBeforePlay;
        public readonly float Volume01;
        public readonly float Pitch;
        public readonly bool Spatial3D;
        public readonly Transform FollowTarget;
        public readonly float MinDistance;
        public readonly float MaxDistance;

        public AudioRequest(AudioClip clip, AudioChannel channel, AudioPlayMode mode,
            bool stopChannelBeforePlay = false,
            float volume01 = 1f, float pitch = 1f, bool spatial3D = false, Transform followTarget = null,
            float minDistance = 1f, float maxDistance = 500f)
        {
            Clip = clip;
            Channel = channel;
            PlayMode = mode;
            StopChannelBeforePlay = stopChannelBeforePlay;
            Volume01 = volume01;
            Pitch = pitch;
            Spatial3D = spatial3D;
            FollowTarget = followTarget;
            MinDistance = minDistance;
            MaxDistance = maxDistance;
        }
    }
}