Merge pull request #11441 from Mailaender/lowbridges

Added static Tiberian Sun low bridges
This commit is contained in:
abcdefg30
2016-08-29 20:53:04 +02:00
committed by GitHub
17 changed files with 1521 additions and 641 deletions

View File

@@ -50,6 +50,13 @@ namespace OpenRA.Mods.Common.Traits
yield return tile + position;
}
public static IEnumerable<CPos> PathableTiles(string name, BuildingInfo buildingInfo, CPos position)
{
var footprint = buildingInfo.Footprint.Where(x => !char.IsWhiteSpace(x)).ToArray();
foreach (var tile in TilesWhere(name, buildingInfo.Dimensions, footprint, a => a == '_'))
yield return tile + position;
}
static IEnumerable<CVec> TilesWhere(string name, CVec dim, char[] footprint, Func<char, bool> cond)
{
if (footprint.Length != dim.X * dim.Y)