some refs to "Game.world" i missed a while ago.

This commit is contained in:
Bob
2010-01-21 13:44:02 +13:00
parent bb5f7dac6b
commit f01990cae1
5 changed files with 9 additions and 9 deletions

View File

@@ -210,7 +210,7 @@ namespace OpenRa
world.CreateActor("mcv", sp, world.players[client.Index]);
}
Game.viewport.GoToStartLocation();
Game.viewport.GoToStartLocation( Game.world.LocalPlayer );
orderManager.StartGame();
}

View File

@@ -23,7 +23,7 @@ namespace OpenRa.GameRules
public Cache<string, List<Actor>> GatherBuildings( Player player )
{
var ret = new Cache<string, List<Actor>>( x => new List<Actor>() );
foreach( var b in Game.world.Actors.Where( x => x.Owner == player && x.Info.Traits.Contains<BuildingInfo>() ) )
foreach( var b in player.World.Actors.Where( x => x.Owner == player && x.Info.Traits.Contains<BuildingInfo>() ) )
{
ret[ b.Info.Name ].Add( b );
var buildable = b.Info.Traits.GetOrDefault<BuildableInfo>();

View File

@@ -81,7 +81,7 @@ namespace OpenRa.Graphics
mapOnlySheet.Texture.SetData(oreLayer);
if (!world.Actors.Any(a => a.Owner == Game.world.LocalPlayer && a.traits.Contains<ProvidesRadar>()))
if (!world.Actors.Any(a => a.Owner == world.LocalPlayer && a.traits.Contains<ProvidesRadar>()))
return;
var bitmap = new Bitmap(oreLayer);
@@ -109,7 +109,7 @@ namespace OpenRa.Graphics
{
for (var y = 0; y < 128; y++)
for (var x = 0; x < 128; x++)
if (!Game.world.LocalPlayer.Shroud.DisplayOnRadar(x, y))
if (!world.LocalPlayer.Shroud.DisplayOnRadar(x, y))
*(c + (y * bitmapData.Stride >> 2) + x) = shroudColor.ToArgb();
}
}

View File

@@ -44,7 +44,7 @@ namespace OpenRa.Graphics
public void DrawRegions( World world )
{
Game.world.WorldRenderer.palette.Update(Game.world.Actors.SelectMany(
world.WorldRenderer.palette.Update(world.Actors.SelectMany(
a => a.traits.WithInterface<IPaletteModifier>()));
float2 r1 = new float2(2, -2) / screenSize;
@@ -54,7 +54,7 @@ namespace OpenRa.Graphics
if( Game.orderManager.GameStarted )
{
Game.world.WorldRenderer.Draw();
world.WorldRenderer.Draw();
Game.chrome.Draw( world );
if (Game.orderManager.IsNetplay &&
@@ -130,9 +130,9 @@ namespace OpenRa.Graphics
scrollPosition = (avgPos - .5f * new float2(Width, Height)).ToInt2();
}
public void GoToStartLocation()
public void GoToStartLocation( Player player )
{
Center(Game.world.Actors.Where(a => a.Owner == Game.world.LocalPlayer && a.traits.Contains<Selectable>()));
Center(player.World.Actors.Where(a => a.Owner == player && a.traits.Contains<Selectable>()));
}
}
}

View File

@@ -24,7 +24,7 @@ namespace OpenRa
set
{
localPlayerIndex = value.Index;
Game.viewport.GoToStartLocation();
Game.viewport.GoToStartLocation( value );
}
}