Converted the GetAttribute methods in the ToolBox class to extension methods

This commit is contained in:
Joonas Rikkonen
2017-10-04 18:38:40 +03:00
parent 6c7c97a875
commit 1ff2054ca8
99 changed files with 854 additions and 875 deletions
@@ -28,15 +28,15 @@ namespace Barotrauma
public FishAnimController(Character character, XElement element)
: base(character, element)
{
waveAmplitude = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "waveamplitude", 0.0f));
waveLength = ConvertUnits.ToSimUnits(ToolBox.GetAttributeFloat(element, "wavelength", 0.0f));
waveAmplitude = ConvertUnits.ToSimUnits(element.GetAttributeFloat("waveamplitude", 0.0f));
waveLength = ConvertUnits.ToSimUnits(element.GetAttributeFloat("wavelength", 0.0f));
steerTorque = ToolBox.GetAttributeFloat(element, "steertorque", 25.0f);
steerTorque = element.GetAttributeFloat("steertorque", 25.0f);
flip = ToolBox.GetAttributeBool(element, "flip", true);
mirror = ToolBox.GetAttributeBool(element, "mirror", false);
flip = element.GetAttributeBool("flip", true);
mirror = element.GetAttributeBool("mirror", false);
float footRot = ToolBox.GetAttributeFloat(element, "footrotation", float.NaN);
float footRot = element.GetAttributeFloat("footrotation", float.NaN);
if (float.IsNaN(footRot))
{
footRotation = null;
@@ -46,7 +46,7 @@ namespace Barotrauma
footRotation = MathHelper.ToRadians(footRot);
}
rotateTowardsMovement = ToolBox.GetAttributeBool(element, "rotatetowardsmovement", true);
rotateTowardsMovement = element.GetAttributeBool("rotatetowardsmovement", true);
}
public override void UpdateAnim(float deltaTime)