Cannot place a tree on top of a tree
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user