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

@@ -34,9 +34,9 @@ namespace OpenRA.Mods.Common.Activities
public FindResources(Actor self)
{
harv = self.Trait<Harvester>();
harvInfo = self.Info.Traits.Get<HarvesterInfo>();
harvInfo = self.Info.TraitInfo<HarvesterInfo>();
mobile = self.Trait<Mobile>();
mobileInfo = self.Info.Traits.Get<MobileInfo>();
mobileInfo = self.Info.TraitInfo<MobileInfo>();
resLayer = self.World.WorldActor.Trait<ResourceLayer>();
territory = self.World.WorldActor.TraitOrDefault<ResourceClaimLayer>();
pathFinder = self.World.WorldActor.Trait<IPathFinder>();