using System.Collections;
using System;

/*
Author: Jan Lygnos
Date:   14.06.2019
*/

/// <summary>
/// Database for all the games audio files.
/// </summary>
public class AudioDatabase : SingletonDontDestroyOnLoad<AudioDatabase> {
    
    public AudioDatabaseAsset DatabaseAsset;

    /// <summary>
    /// Accesses registered Audios.
    /// </summary>
    /// <param name="name">the name of the registered Audio</param>
    /// <returns>the registered Audio</returns>
    public Audio AccessAudio(string name) => DatabaseAsset.RegisteredAudio.Find(audio => audio.Name == name);

    public Audio AccessAudio(int id) => DatabaseAsset.RegisteredAudio[id];
}
