Ore.cs is dead. Long live ResourceLayer.cs.

This commit is contained in:
Chris Forbes
2010-03-03 21:15:44 +13:00
parent 6c229f3273
commit 15b82830a2
8 changed files with 14 additions and 74 deletions

View File

@@ -67,10 +67,11 @@ namespace OpenRA
var position = Game.controller.MousePosition.ToInt2();
var topLeft = position - Footprint.AdjustForBuildingSize( bi );
var isCloseEnough = world.IsCloseEnoughToBase(world.LocalPlayer, name, bi, topLeft);
var res = world.WorldActor.traits.Get<ResourceLayer>();
foreach( var t in Footprint.Tiles( name, bi, topLeft ) )
spriteRenderer.DrawSprite( ( isCloseEnough && world.IsCellBuildable( t, bi.WaterBound
? UnitMovementType.Float : UnitMovementType.Wheel ) && !world.Map.ContainsResource( t ) )
? UnitMovementType.Float : UnitMovementType.Wheel ) && res.GetResource(t) == null )
? buildOk : buildBlocked, Game.CellSize * t, "terrain" );
// Linebuild for walls.