Added FacingInit and AltitudeInit. Used in Mobile/Aircraft/Husks. Refactored Production, SpyPlane, Paratroopers and LeavesHusk

This commit is contained in:
alzeih
2010-08-02 00:49:26 +12:00
parent 2cc6e197fa
commit 4ea66ea309
8 changed files with 83 additions and 19 deletions

View File

@@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.Linq;
using OpenRA.GameRules;
using System.Drawing;
using OpenRA.FileFormats;
namespace OpenRA.Traits
{
@@ -55,8 +56,11 @@ namespace OpenRA.Traits
if( location == null || self.World.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt( location.Value ).Any() )
return false;
var newUnit = self.World.CreateActor( producee.Name, location.Value, self.Owner );
newUnit.traits.Get<IFacing>().Facing = CreationFacing( self, newUnit ); ;
var newUnit = self.World.CreateActor( producee.Name, new TypeDictionary
{
new LocationInit( location.Value ),
new OwnerInit( self.Owner ),
});
var pi = self.Info.Traits.Get<ProductionInfo>();
var rp = self.traits.GetOrDefault<RallyPoint>();