1.移除一个bug。

2.删除最后一次的塔位,并放置新的塔位。

Signed-off-by: facat <facat@facat.com>
This commit is contained in:
facat 2020-05-31 08:20:39 +08:00
parent 736b6ff2f8
commit 7ce4357fbe
1 changed files with 13 additions and 3 deletions

View File

@ -93,9 +93,16 @@ namespace PutTowerPosition
{ {
DBText latestTowerName = acTrans.GetObject(tower.name, OpenMode.ForWrite) as DBText; DBText latestTowerName = acTrans.GetObject(tower.name, OpenMode.ForWrite) as DBText;
DBPoint latestTowerPoint = acTrans.GetObject(tower.point, OpenMode.ForWrite) as DBPoint; DBPoint latestTowerPoint = acTrans.GetObject(tower.point, OpenMode.ForWrite) as DBPoint;
if (latestTowerName != null)
{
latestTowerName.Erase(); latestTowerName.Erase();
}
if (latestTowerPoint != null)
{
latestTowerPoint.Erase(); latestTowerPoint.Erase();
} }
}
latestTowerList.Clear(); latestTowerList.Clear();
} }
@ -308,7 +315,10 @@ namespace PutTowerPosition
} }
string norm_line; string norm_line;
norm_line = Regex.Replace(line, @"\s+", ","); norm_line = Regex.Replace(line, @"\s+", ",");
if (norm_line.StartsWith(","))
{
norm_line = norm_line.Substring(1); norm_line = norm_line.Substring(1);
}
string[] sep = norm_line.Split(','); string[] sep = norm_line.Split(',');
string towerName = sep[0]; string towerName = sep[0];
if (has_tower.ContainsKey(towerName)) if (has_tower.ContainsKey(towerName))