RTSEngine.Data.Team.RTSSquad.RemoveAll C# (CSharp) Метод

RemoveAll() публичный Метод

public RemoveAll ( Predicate f ) : void
f Predicate
Результат void
        public void RemoveAll(Predicate<RTSUnit> f)
        {
            List<RTSUnit> nUnits = new List<RTSUnit>(units.Count);
            for(int i = 0; i < units.Count; i++) {
                if(f(units[i])) {
                    if(OnUnitRemoval != null)
                        OnUnitRemoval(this, units[i]);
                }
                else nUnits.Add(units[i]);
            }

            // Set The New List Of Units
            units = nUnits;

            // Check Death Condition
            if(IsDead && OnDeath != null)
                OnDeath(this);
        }