added ISpawnStartingUnits trait; default impl just spawns an MCV

This commit is contained in:
Chris Forbes
2010-02-13 21:14:15 +13:00
parent 641c21107e
commit 3462607e9a
6 changed files with 23 additions and 8 deletions

View File

@@ -0,0 +1,13 @@
namespace OpenRa.Traits
{
class SpawnDefaultUnitsInfo : StatelessTraitInfo<SpawnDefaultUnits> { }
class SpawnDefaultUnits : ISpawnStartingUnits
{
public void SpawnStartingUnits(Player p, int2 sp)
{
p.PlayerActor.World.CreateActor("mcv", sp, p);
}
}
}

View File

@@ -104,4 +104,5 @@ namespace OpenRa.Traits
public interface INotifySelection { void SelectionChanged(); }
public interface ILoadWorldHook { void WorldLoaded(World w); }
public interface ISpawnStartingUnits { void SpawnStartingUnits(Player p, int2 sp); }
}