cleanup some relics of old TypeDictionary

This commit is contained in:
Chris Forbes
2010-01-15 18:06:17 +13:00
parent 4e7c604764
commit baca523c3c
5 changed files with 5 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ namespace OpenRa.Game.Orders
var loc = mi.Location + Game.viewport.Location; var loc = mi.Location + Game.viewport.Location;
var underCursor = Game.FindUnits(loc, loc) var underCursor = Game.FindUnits(loc, loc)
.Where(a => a.Owner == Game.LocalPlayer .Where(a => a.Owner == Game.LocalPlayer
&& a.traits.WithInterface<Chronoshiftable>().Any() && a.traits.Contains<Chronoshiftable>()
&& a.traits.Contains<Selectable>()).FirstOrDefault(); && a.traits.Contains<Selectable>()).FirstOrDefault();
if (underCursor != null) if (underCursor != null)

View File

@@ -79,7 +79,7 @@ namespace OpenRa.Game.Traits
if (a.traits.Contains<AutoHeal>()) if (a.traits.Contains<AutoHeal>())
return PipType.Yellow; return PipType.Yellow;
if (!a.traits.WithInterface<AttackBase>().Any()) if (!a.traits.Contains<AttackBase>())
return PipType.Yellow; // noncombat [E6,SPY,THF] return PipType.Yellow; // noncombat [E6,SPY,THF]
if (a.traits.Contains<C4Demolition>()) if (a.traits.Contains<C4Demolition>())
return PipType.Red; // E7 return PipType.Red; // E7

View File

@@ -14,7 +14,7 @@ namespace OpenRa.Game.Traits
{ {
if (mi.Button != MouseButton.Right) return null; if (mi.Button != MouseButton.Right) return null;
if (underCursor != null) return null; if (underCursor != null) return null;
if (underCursor.traits.WithInterface<IAcceptSpy>().Any()) return null; if (underCursor.traits.Contains<IAcceptSpy>()) return null;
return new Order("Infiltrate", self, underCursor, int2.Zero, null); return new Order("Infiltrate", self, underCursor, int2.Zero, null);
} }

View File

@@ -11,7 +11,7 @@ namespace OpenRa.Game.Traits
{ {
if (mi.Button != MouseButton.Right) return null; if (mi.Button != MouseButton.Right) return null;
if (underCursor == null) return null; if (underCursor == null) return null;
if (!underCursor.traits.WithInterface<IAcceptThief>().Any()) return null; if (!underCursor.traits.Contains<IAcceptThief>()) return null;
return new Order("Steal", self, underCursor, int2.Zero, null); return new Order("Steal", self, underCursor, int2.Zero, null);
} }

View File

@@ -25,7 +25,7 @@ namespace OpenRa.Game
// Does this belong here? NO, but it's your mess. // Does this belong here? NO, but it's your mess.
// Get the crushable actors // Get the crushable actors
foreach (var a in Game.world.Actors.Where(b => b.traits.WithInterface<ICrushable>().Any())) foreach (var a in Game.world.Actors.Where(b => b.traits.Contains<ICrushable>()))
{ {
// Are there any units in the same cell that can crush this? // Are there any units in the same cell that can crush this?
foreach( var ios in a.traits.WithInterface<IOccupySpace>() ) foreach( var ios in a.traits.WithInterface<IOccupySpace>() )