Allow rules to be constructed from a MapPreview.

This commit is contained in:
Paul Chote
2016-03-09 19:17:14 +00:00
parent 43a3d42d31
commit be5eee0227
4 changed files with 98 additions and 17 deletions

View File

@@ -25,7 +25,7 @@ namespace OpenRA
{
public sealed class MapCache : IEnumerable<MapPreview>, IDisposable
{
public static readonly MapPreview UnknownMap = new MapPreview(null, MapGridType.Rectangular, null);
public static readonly MapPreview UnknownMap = new MapPreview(null, null, MapGridType.Rectangular, null);
public readonly IReadOnlyDictionary<IReadOnlyPackage, MapClassification> MapLocations;
readonly Cache<string, MapPreview> previews;
@@ -41,7 +41,7 @@ namespace OpenRA
this.modData = modData;
var gridType = Exts.Lazy(() => modData.Manifest.Get<MapGrid>().Type);
previews = new Cache<string, MapPreview>(uid => new MapPreview(uid, gridType.Value, this));
previews = new Cache<string, MapPreview>(uid => new MapPreview(modData, uid, gridType.Value, this));
sheetBuilder = new SheetBuilder(SheetType.BGRA);
// Enumerate map directories