public bool DoSA(List <IUnit> friends, List <IUnit> enemies, Army A) { if (friends.Count() <= 1) { return(false); } for (int i = 0; i < friends.Count(); i++) { if (friends[i] is HeavyUnit || friends[i] is Decorate) { IUnit B; if (friends[i] is Decorate) { B = friends[i]; } else { B = new Decorate((HeavyUnit)(friends[i])); } if (arr[0] == 1) { if (((Decorate)B).YouHaveSH()) { arr[0] = 0; A.Change(friends[i], B); } } else if (arr[1] == 1) { if (((Decorate)B).YouHaveK()) { arr[1] = 0; A.Change(friends[i], B); } } else if (arr[2] == 1) { if (((Decorate)B).YouHaveL()) { arr[2] = 0; A.Change(friends[i], B); } } break; } } return(false); }