remove special case in World for InitOreDensity()

This commit is contained in:
Chris Forbes
2010-02-09 13:23:09 +13:00
parent 758af41dc1
commit 7729d31b6a
2 changed files with 7 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ namespace OpenRa.Traits
public object Create(Actor self) { return new OreGrowth(); }
}
class OreGrowth : ITick
class OreGrowth : ITick, ILoadWorldHook
{
int remainingTicks;
@@ -38,5 +38,10 @@ namespace OpenRa.Traits
remainingTicks = (int)(info.Interval * 60 * 25);
}
}
public void WorldLoaded(World w)
{
Ore.InitOreDensity(w.Map);
}
}
}

View File

@@ -34,7 +34,6 @@ namespace OpenRa
}
if (!string.IsNullOrEmpty(Game.Settings.PlayerName) && LocalPlayer.PlayerName != Game.Settings.PlayerName)
Game.IssueOrder(Order.Chat("/name " + Game.Settings.PlayerName));
}
public readonly Actor WorldActor;
@@ -63,15 +62,11 @@ namespace OpenRa
WorldRenderer = new WorldRenderer(this, Game.renderer);
Timer.Time("renderer: {0}");
Map.InitOreDensity();
Timer.Time( "Ore: {0}" );
WorldActor = CreateActor("World", new int2(int.MaxValue, int.MaxValue), null);
for (int i = 0; i < 8; i++)
{
players[i] = new Player(this, i, Game.LobbyInfo.Clients.FirstOrDefault(a => a.Index == i));
}
Timer.Time( "worldActor, players: {0}" );
Queries = new AllQueries( this );