moved BIM/UIM to World, and added World.CreateActor

This commit is contained in:
Bob
2010-01-17 12:50:16 +13:00
parent 79a5966af7
commit e792c9ce17
20 changed files with 55 additions and 52 deletions

View File

@@ -32,10 +32,10 @@ namespace OpenRa.Traits
public bool Produce( Actor self, ActorInfo producee )
{
var location = CreationLocation( self, producee );
if( location == null || Game.UnitInfluence.GetUnitsAt( location.Value ).Any() )
if( location == null || Game.world.UnitInfluence.GetUnitsAt( location.Value ).Any() )
return false;
var newUnit = new Actor( producee.Name, location.Value, self.Owner );
var newUnit = Game.world.CreateActor( producee.Name, location.Value, self.Owner );
newUnit.traits.Get<Unit>().Facing = CreationFacing( self, newUnit ); ;
var rp = self.traits.GetOrDefault<RallyPoint>();
@@ -51,8 +51,6 @@ namespace OpenRa.Traits
newUnit.CenterLocation = self.CenterLocation
+ new float2(pi.SpawnOffset[0], pi.SpawnOffset[1]);
Game.world.Add( newUnit );
foreach (var t in self.traits.WithInterface<INotifyProduction>())
t.UnitProduced(self, newUnit);