public void RemoveUGV(string ugvId) { UGV removeUGV = new UGV(); foreach (Group group in MVCCGroupList) { foreach (UGV tempUGV in group.MemberList) { if (tempUGV.Equals(removeUGV)) { group.MemberList.Remove(removeUGV); if (group.MemberList.Count == 0) { MVCCGroupList.Remove(group); } break; } } } for (int i = 0; i < MVCCItemList.Count; i++) { if (!(MVCCItemList[i] is UGV)) { continue; } UGV tempUGV = MVCCItemList[i] as UGV; if (tempUGV.Id.Equals(ugvId)) { removeUGV = tempUGV; break; } } // 없어진 UGV 상태 제거 foreach (State state in MVCCItemStateList) { if (state.ugv.Equals(removeUGV)) { MVCCItemStateList.Remove(state); break; } } MVCCItemList.Remove(removeUGV); }
/** * 추대윤 추가 * 빌딩이 사라졌을때, 제거하는 메소드 * */ public void RemoveBuilding(string ugvId) { Building removeUGV = new Building(); for (int i = 0; i < MVCCItemList.Count; i++) { if (!(MVCCItemList[i] is Building)) { continue; } Building tempBuilding = MVCCItemList[i] as Building; if (tempBuilding.Id.Equals(ugvId)) { removeUGV = tempBuilding; MVCCItemList.Remove(removeUGV); break; } } }