Protogame.DefaultPlatforming.ApplyActionUntil C# (CSharp) Méthode

ApplyActionUntil() public méthode

The apply action until.
public ApplyActionUntil ( IBoundingBox entity, Action action, bool>.Func check, int maximum ) : void
entity IBoundingBox /// The entity. ///
action Action /// The action. ///
check bool>.Func /// The check. ///
maximum int /// The maximum. ///
Résultat void
        public void ApplyActionUntil(
            IBoundingBox entity, 
            Action<IBoundingBox> action, 
            Func<IBoundingBox, bool> check, 
            int? maximum)
        {
            if (maximum == null)
            {
                while (!check(entity))
                {
                    action(entity);
                }
            }
            else
            {
                for (var i = 0; i < maximum.Value; i++)
                {
                    if (!check(entity))
                    {
                        action(entity);
                    }
                }
            }
        }