local player buildings influence map, incrementally updated.

This commit is contained in:
Chris Forbes
2009-10-13 18:13:22 +13:00
parent e255a48645
commit 0f0b4230c7
6 changed files with 81 additions and 25 deletions

View File

@@ -35,5 +35,23 @@ namespace OpenRa.Game.GameRules
buildingFootprints = buildings
.ToDictionary(a => a.Name, a => a.Pat);
}
public static IEnumerable<int2> Tiles(string name, int2 position)
{
var footprint = Rules.Footprint.GetFootprint(name);
var j = 0;
foreach (var row in footprint)
{
var i = 0;
foreach (var c in row)
{
if (c != '_')
yield return position + new int2(i, j);
++i;
}
++j;
}
}
}
}