using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

public enum CharacterId{
    Death = 0,
    TONY = 1,
    SUE = 2,
    MARTIN = 3,
    MARY = 4,
    ROMEO = 5,
    JULIET = 6,
    BOB = 7,
    GEMMA = 8,
    POLICE_STATION = 9,
    EMBASSY = 10,
    DELIVERY_RESTAURANT = 11,
    INTERNATIONAL_NUMBERS,
    NONE = 99,
}

public class TransmissionData
{
    public bool TransmissionUsed;
    public int TransmissionId;
    public CharacterId FromCharacterId;
    public CharacterId ToCharacterId;
    public string AudioFileName;
    public Dictionary<int, string> ImmediateAudioFeedbackFileName;
    public float DelayTime;
    public int EffectId;
    public int StartDay;
    public Dictionary<CharacterId, string> EndGameConnectedText;
    public Dictionary<int, string> EndGameConnectedImageFileName;
    public Dictionary<CharacterId, int> ConnectedTransmissionId;
    public List<CharacterId> CharacterToKill;

    public Dictionary<CharacterId, AudioClip> ImmediateAudioFeedback;
    public Dictionary<CharacterId, Sprite> EndGameConnectedImage;
    public AudioClip AudioContent;

    public void SetupTransmission()
    {
        ImmediateAudioFeedback = new Dictionary<CharacterId, AudioClip>();
        EndGameConnectedImage = new Dictionary<CharacterId, Sprite>();
        AudioContent = Resources.Load("TransmissionAudioContent/" + AudioFileName) as AudioClip;
        foreach (var pair in ImmediateAudioFeedbackFileName)
        {
            if (pair.Value != "")
            {
                ImmediateAudioFeedback.Add((CharacterId)pair.Key, Resources.Load("TransmissionImmediateAudioFeedback/" + pair.Value) as AudioClip);
            }
        }

        foreach (var pair in EndGameConnectedImageFileName)
        {
            if (pair.Value != "")
            {
                EndGameConnectedImage.Add((CharacterId)pair.Key, Resources.Load("TransmissionEndGameConnectedImage/" + pair.Value) as Sprite);
            }
        }
    }
}
