start cleaning up IWorldLoadHook vs IGameStarted -- IGameStarted dies.

This commit is contained in:
Chris Forbes
2010-08-25 21:53:54 +12:00
parent 50066ec238
commit f4da83e920
13 changed files with 23 additions and 26 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA
public object Create(ActorInitializer init) { return new BridgeLayer(init.self, this); }
}
class BridgeLayer : ILoadWorldHook
class BridgeLayer : IWorldLoaded
{
readonly BridgeLayerInfo Info;
readonly World world;

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA
{
class ColorPickerPaletteModifierInfo : TraitInfo<ColorPickerPaletteModifier> {}
class ColorPickerPaletteModifier : IPaletteModifier, ILoadWorldHook
class ColorPickerPaletteModifier : IPaletteModifier, IWorldLoaded
{
bool SplitPlayerPalette;
public void WorldLoaded(World w)

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA
{
class DefaultShellmapScriptInfo : TraitInfo<DefaultShellmapScript> { }
class DefaultShellmapScript: ILoadWorldHook, ITick
class DefaultShellmapScript: IWorldLoaded, ITick
{
Dictionary<string, Actor> Actors;

View File

@@ -15,9 +15,9 @@ namespace OpenRA.Mods.RA
{
class SpawnMPUnitsInfo : TraitInfo<SpawnMPUnits>, ITraitPrerequisite<MPStartLocationsInfo> {}
class SpawnMPUnits : IGameStarted
class SpawnMPUnits : IWorldLoaded
{
public void GameStarted(World world)
public void WorldLoaded(World world)
{
foreach (var s in world.WorldActor.Trait<MPStartLocations>().Start)
SpawnUnitsForPlayer(s.Key, s.Value);

View File

@@ -15,17 +15,17 @@ namespace OpenRA.Mods.RA
{
public class SpawnMapActorsInfo : TraitInfo<SpawnMapActors> { }
public class SpawnMapActors : IGameStarted
public class SpawnMapActors : IWorldLoaded
{
public Dictionary<string, Actor> Actors = new Dictionary<string, Actor>();
public void GameStarted(World world)
public void WorldLoaded(World world)
{
foreach( var actorReference in world.Map.Actors )
foreach (var actorReference in world.Map.Actors)
{
var initDict = actorReference.Value.InitDict;
initDict.Add( new SkipMakeAnimsInit() );
Actors[ actorReference.Key ] = world.CreateActor( actorReference.Value.Type, initDict );
initDict.Add(new SkipMakeAnimsInit());
Actors[actorReference.Key] = world.CreateActor(actorReference.Value.Type, initDict);
}
}
}