Unknown race -> Random; make it actually work, too.

This commit is contained in:
Chris Forbes
2010-03-18 13:18:41 +13:00
parent c17459310a
commit 8a05af72b3
4 changed files with 14 additions and 8 deletions

View File

@@ -86,5 +86,11 @@ namespace OpenRA
d.Add( k, ret = createFn( k ) );
return ret;
}
public static T Random<T>(this IEnumerable<T> ts, Thirdparty.Random r)
{
var xs = ts.ToArray();
return xs[r.Next(xs.Length)];
}
}
}