Inserted calculation if hover over enemy

Though text is not displayed, only the calculation is done.
This commit is contained in:
Niklas Ulf Anders Cullberg
2012-10-20 11:56:06 +02:00
parent f8c1422eeb
commit 6034dbf3b2
+14
View File
@@ -118,6 +118,20 @@ namespace DepthsBelow
readjust = false; readjust = false;
} }
} }
//Calculating chance to hit if holding cursor over enemy
foreach (var unit in core.Squad)
{
if (unit.Selected == true && unit.Fired == false)
{
foreach (var enemy in core.Swarm)
{
if (gridRectangle.Intersects(enemy.GetComponent<Component.Collision>().Rectangle))
{
Utility.CalculateHitChance(unit, enemy);
}
}
}
}
} }
// When the mouse is released // When the mouse is released
if (ms.LeftButton == ButtonState.Released && selectionRectangle != Rectangle.Empty) if (ms.LeftButton == ButtonState.Released && selectionRectangle != Rectangle.Empty)