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
@@ -16,8 +16,8 @@ namespace Barotrauma
public SpriteSheet(XElement element, string path = "", string file = "")
: base(element, path, file)
{
int columnCount = Math.Max(ToolBox.GetAttributeInt(element, "columns", 1), 1);
int rowCount = Math.Max(ToolBox.GetAttributeInt(element, "rows", 1), 1);
int columnCount = Math.Max(element.GetAttributeInt("columns", 1), 1);
int rowCount = Math.Max(element.GetAttributeInt("rows", 1), 1);
sourceRects = new Rectangle[rowCount * columnCount];
@@ -32,7 +32,7 @@ namespace Barotrauma
}
}
origin = ToolBox.GetAttributeVector2(element, "origin", new Vector2(0.5f, 0.5f));
origin = element.GetAttributeVector2("origin", new Vector2(0.5f, 0.5f));
origin.X = origin.X * cellWidth;
origin.Y = origin.Y * cellHeight;
}