StyleCop clean Map
move non-map specific functions to FileFormats
This commit is contained in:
@@ -232,6 +232,16 @@ namespace OpenRA
|
||||
return result;
|
||||
}
|
||||
|
||||
public static T[,] ResizeArray<T>(T[,] ts, T t, int width, int height)
|
||||
{
|
||||
var result = new T[width, height];
|
||||
for (var i = 0; i < width; i++)
|
||||
for (var j = 0; j < height; j++)
|
||||
result[i, j] = i <= ts.GetUpperBound(0) && j <= ts.GetUpperBound(1)
|
||||
? ts[i, j] : t;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Rectangle Bounds(this Bitmap b) { return new Rectangle(0, 0, b.Width, b.Height); }
|
||||
|
||||
public static int ToBits(this IEnumerable<bool> bits)
|
||||
|
||||
@@ -99,6 +99,11 @@ namespace OpenRA.FileFormats
|
||||
return new MiniYaml( null, list.Select( x => new MiniYamlNode( x.ToString(), new MiniYaml( null ) ) ).ToList() );
|
||||
}
|
||||
|
||||
public static List<MiniYamlNode> NodesOrEmpty(MiniYaml y, string s)
|
||||
{
|
||||
return y.NodesDict.ContainsKey(s) ? y.NodesDict[s].Nodes : new List<MiniYamlNode>();
|
||||
}
|
||||
|
||||
static List<MiniYamlNode> FromLines(string[] lines, string filename)
|
||||
{
|
||||
var levels = new List<List<MiniYamlNode>>();
|
||||
|
||||
Reference in New Issue
Block a user