private bool LevelUpUnit(Unit unit) { unitsMach = CheckUnits(unit); if (unitsMach.Count > 1) { foreach (Unit u in unitsMach) { u.DestroyUnit(); } unit.LevelUp(); unitsMach.Clear(); return(true); } return(false); }
private void CheckUnitsOnMap(Unit unit) { List <Unit> units = new List <Unit>(); foreach (Unit u in UnionUnits) { if (u.CheckUnits(unit)) { units.Add(u); } } if (units.Count > 1) { foreach (Unit u in units) { u.DestroyUnit(); } unit.LevelUp(); CheckUnitsOnMap(unit); } }