/*
 * UnityArgumentOutOfRange.cs
 * Unity compatibility helpers for RVO2 Library C#.
 *
 * SPDX-FileCopyrightText: 2008 University of North Carolina at Chapel Hill
 * SPDX-License-Identifier: Apache-2.0
 */

using System;

namespace RVO
{
    internal static class UnityArgumentOutOfRange
    {
        public static void ThrowIfNegative(int value, string paramName)
        {
            if (value < 0)
            {
                throw new ArgumentOutOfRangeException(paramName);
            }
        }

        public static void ThrowIfNegative(float value, string paramName)
        {
            if (value < 0f)
            {
                throw new ArgumentOutOfRangeException(paramName);
            }
        }

        public static void ThrowIfNegativeOrZero(float value, string paramName)
        {
            if (value <= 0f)
            {
                throw new ArgumentOutOfRangeException(paramName);
            }
        }

        public static void ThrowIfGreaterThanOrEqual(int value, int other, string paramName)
        {
            if (value >= other)
            {
                throw new ArgumentOutOfRangeException(paramName);
            }
        }
    }
}
