Cleanup with resharper (mostly removing redundancies & using collection.Length/Count properties instead of the Count method)

This commit is contained in:
Regalis
2016-10-31 20:35:04 +02:00
parent 5cc605bc01
commit eb2c51c2f1
46 changed files with 93 additions and 200 deletions
+8 -5
View File
@@ -186,18 +186,21 @@ namespace Barotrauma
foreach (XAttribute attribute in subElement.Attributes())
{
InputType inputType;
Keys key;
int mouseButton;
if (Enum.TryParse(attribute.Name.ToString(), true, out inputType))
{
int mouseButton;
if (int.TryParse(attribute.Value.ToString(), out mouseButton))
{
keyMapping[(int)inputType] = new KeyOrMouse(mouseButton);
}
else if (Enum.TryParse(attribute.Value.ToString(), true, out key))
else
{
keyMapping[(int)inputType] = new KeyOrMouse(key);
}
Keys key;
if (Enum.TryParse(attribute.Value.ToString(), true, out key))
{
keyMapping[(int)inputType] = new KeyOrMouse(key);
}
}
}
}
break;