using System; using System.Collections.Generic; using System.Linq; using OpenRa.FileFormats; using OpenRa.Support; using OpenRa.Traits; namespace OpenRa.Traits { class GeneratesGapInfo : ITraitInfo { public readonly int Range = 10; public object Create(Actor self) { return new GeneratesGap(self); } } class GeneratesGap { Actor self; public GeneratesGap(Actor self) { this.self = self; } public IEnumerable GetShroudedTiles() { int range = self.Info.Traits.Get().Range; // Gap Generator building; powered down if (self.traits.Contains() && self.traits.Get().Disabled) yield break; foreach (var t in Game.FindTilesInCircle(self.Location, range)) yield return t; } } }