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
@@ -396,9 +396,9 @@ namespace Barotrauma
public static Map LoadNew(XElement element)
{
string mapSeed = ToolBox.GetAttributeString(element, "seed", "a");
string mapSeed = element.GetAttributeString("seed", "a");
int size = ToolBox.GetAttributeInt(element, "size", 1000);
int size = element.GetAttributeInt("size", 1000);
Map map = new Map(mapSeed, size);
map.Load(element);
@@ -407,9 +407,9 @@ namespace Barotrauma
public void Load(XElement element)
{
SetLocation(ToolBox.GetAttributeInt(element, "currentlocation", 0));
SetLocation(element.GetAttributeInt("currentlocation", 0));
string discoveredStr = ToolBox.GetAttributeString(element, "discovered", "");
string discoveredStr = element.GetAttributeString("discovered", "");
string[] discoveredStrs = discoveredStr.Split(',');
for (int i = 0; i < discoveredStrs.Length; i++)
@@ -418,7 +418,7 @@ namespace Barotrauma
if (int.TryParse(discoveredStrs[i], out index)) locations[index].Discovered = true;
}
string passedStr = ToolBox.GetAttributeString(element, "passed", "");
string passedStr = element.GetAttributeString("passed", "");
string[] passedStrs = passedStr.Split(',');
for (int i = 0; i < passedStrs.Length; i++)
{