Cannot place a tree on top of a tree

This commit is contained in:
2018-02-23 20:28:02 -06:00
parent ef54588253
commit a41aee0dc4
3 changed files with 37 additions and 1 deletions

View File

@ -502,6 +502,23 @@ namespace EduNetworkBuilder
return null;
}
public bool BlockedByTree(Point NetworkLocation)
{
NetworkDevice tDevice;
foreach (NetworkComponent tItem in NetComponents)
{
if (tItem is NetworkDevice)
{
tDevice = (NetworkDevice)tItem;
if (tDevice.GetNetType() != NetworkComponentType.tree) continue; //We only care about trees
Rectangle myRec = tDevice.GetMyRectangle();
if (myRec.Contains(NetworkLocation))
return true;
}
}
return false;
}
public NetworkLink LinkAtPosition(Point NetworkLocation)
{
NetworkLink tLink;