More resharper cleanup

This commit is contained in:
Regalis11
2015-06-07 18:03:08 +03:00
parent f786cd3016
commit 34b79c85d6
62 changed files with 99 additions and 195 deletions
+4 -6
View File
@@ -35,8 +35,6 @@ namespace Subsurface
static class AmbientSoundManager
{
private static Sound[] music = new Sound[4];
public static Sound[] flowSounds = new Sound[3];
private static Sound waterAmbience;
@@ -57,9 +55,9 @@ namespace Subsurface
XDocument doc = ToolBox.TryLoadXml(filePath);
if (doc == null) return;
var xDamageSounds = doc.Root.Elements("damagesound");
if (xDamageSounds.Count()>0)
var xDamageSounds = doc.Root.Elements("damagesound").ToList();
if (!xDamageSounds.Any())
{
damageSounds = new DamageSound[xDamageSounds.Count()];
int i = 0;
@@ -124,7 +122,7 @@ namespace Subsurface
{
damage = MathHelper.Clamp(damage, 0.0f, 100.0f);
var sounds = damageSounds.Where(x => damage >= x.damageRange.X && damage <= x.damageRange.Y && x.damageType == damageType).ToList();
if (sounds.Count() == 0) return;
if (!sounds.Any()) return;
int selectedSound = Game1.localRandom.Next(sounds.Count());
+2 -2
View File
@@ -204,14 +204,14 @@ namespace Subsurface
{
loadedSounds.Remove(this);
System.Diagnostics.Debug.WriteLine(this.AlBufferId);
System.Diagnostics.Debug.WriteLine(AlBufferId);
foreach (Sound s in loadedSounds)
{
if (s.oggSound == oggSound) return;
}
SoundManager.ClearAlSource(this.AlBufferId);
SoundManager.ClearAlSource(AlBufferId);
oggSound.Dispose();
}