Add ActorInfo.TraitInfo[OrDefault]<T>() requiring ITraitIfo types

This commit is contained in:
atlimit8
2015-08-03 16:07:33 -05:00
parent 6970959ef1
commit 09984683a7
115 changed files with 195 additions and 193 deletions

View File

@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
public List<CPos> FindUnitPath(CPos source, CPos target, Actor self)
{
var mi = self.Info.Traits.Get<MobileInfo>();
var mi = self.Info.TraitInfo<MobileInfo>();
// If a water-land transition is required, bail early
var domainIndex = world.WorldActor.TraitOrDefault<DomainIndex>();
@@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Traits
public List<CPos> FindUnitPathToRange(CPos source, SubCell srcSub, WPos target, WDist range, Actor self)
{
var mi = self.Info.Traits.Get<MobileInfo>();
var mi = self.Info.TraitInfo<MobileInfo>();
var targetCell = world.Map.CellContaining(target);
// Correct for SubCell offset