ProjectStorms.ShipPartDestroy.IsPartTypeDestroyed C# (CSharp) Méthode

IsPartTypeDestroyed() public méthode

Returns whether a part of the input type is still active.
public IsPartTypeDestroyed ( EShipPartType a_type ) : bool
a_type EShipPartType Ship part type.
Résultat bool
        public bool IsPartTypeDestroyed(EShipPartType a_type)
        {
            bool partActive = false;
            foreach (ShipPart part in destructableParts)
            {
                // If any part is still around, return true
                if (part.partType == a_type && !IsPartDestroyed(part))
                {
                    partActive = true;
                }
            }
            return !partActive;
        }