fixed Building.unitInfo

This commit is contained in:
Bob
2010-01-12 20:18:36 +13:00
parent d5d6812e07
commit 4a004eda0f
9 changed files with 40 additions and 38 deletions

View File

@@ -2,6 +2,7 @@ using System.Drawing;
using System.Linq;
using OpenRa.Game.GameRules;
using OpenRa.Game.Graphics;
using OpenRa.Game.Traits;
namespace OpenRa.Game
{
@@ -42,12 +43,12 @@ namespace OpenRa.Game
spriteRenderer.DrawSprite(unitDebug, Game.CellSize * new float2(i, j), 0);
}
public void DrawBuildingGrid( LegacyBuildingInfo bi )
public void DrawBuildingGrid( string name, BuildingInfo bi )
{
var position = Game.controller.MousePosition.ToInt2();
var isCloseEnough = Game.IsCloseEnoughToBase(Game.LocalPlayer, bi, position);
var isCloseEnough = Game.IsCloseEnoughToBase(Game.LocalPlayer, name, bi, position);
foreach( var t in Footprint.Tiles( bi, position ) )
foreach( var t in Footprint.Tiles( name, bi, position ) )
spriteRenderer.DrawSprite( ( isCloseEnough && Game.IsCellBuildable( t, bi.WaterBound
? UnitMovementType.Float : UnitMovementType.Wheel ) && !Rules.Map.ContainsResource( t ) )
? buildOk : buildBlocked, Game.CellSize * t, 0 );