RTSEngine.Data.Team.RTSSquad.Remove C# (CSharp) Method

Remove() public method

public Remove ( RTSUnit u ) : void
u RTSUnit
return void
        public void Remove(RTSUnit u)
        {
            // Make Sure Unit Is In The Squad
            if(u.Squad == this) {
                // Remove All References
                units.Remove(u);
                u.OnDestruction -= OnUnitDestruction;

                // Send Update Event
                if(OnUnitRemoval != null)
                    OnUnitRemoval(this, u);

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