Terraria.ModLoader.SoundLoader.PlayModSound C# (CSharp) Method

PlayModSound() static private method

static private PlayModSound ( int type, int style, float volume, float pan, SoundEffectInstance &soundEffectInstance ) : bool
type int
style int
volume float
pan float
soundEffectInstance Microsoft.Xna.Framework.Audio.SoundEffectInstance
return bool
        internal static bool PlayModSound(int type, int style, float volume, float pan, ref SoundEffectInstance soundEffectInstance)
        {
            SoundType soundType;
            switch (type)
            {
                case 2:
                    soundType = SoundType.Item;
                    break;
                case 3:
                    soundType = SoundType.NPCHit;
                    break;
                case 4:
                    soundType = SoundType.NPCKilled;
                    break;
                case customSoundType:
                    soundType = SoundType.Custom;
                    break;
                default:
                    return false;
            }
            if (!modSounds[soundType].ContainsKey(style))
            {
                return false;
            }
            soundEffectInstance = modSounds[soundType][style].PlaySound(ref GetSoundInstanceArray(soundType)[style], volume, pan, soundType);
            return true;
        }