コード例 #1
0
        public bool Qualifies(CoinTrajectory coinTrajectory)
        {
            double hSpeed = coinTrajectory.HSpeed;
            double vSpeed = coinTrajectory.VSpeed;
            double angle  = coinTrajectory.Angle;

            if (HSpeedMinNullable.HasValue)
            {
                double hSpeedMin = HSpeedMinNullable.Value;
                if (hSpeed < hSpeedMin)
                {
                    return(false);
                }
            }

            if (HSpeedMaxNullable.HasValue)
            {
                double hSpeedMax = HSpeedMaxNullable.Value;
                if (hSpeed > hSpeedMax)
                {
                    return(false);
                }
            }

            if (VSpeedMinNullable.HasValue)
            {
                double vSpeedMin = VSpeedMinNullable.Value;
                if (vSpeed < vSpeedMin)
                {
                    return(false);
                }
            }

            if (VSpeedMaxNullable.HasValue)
            {
                double vSpeedMax = VSpeedMaxNullable.Value;
                if (vSpeed > vSpeedMax)
                {
                    return(false);
                }
            }

            if (AngleMinNullable.HasValue && AngleMaxNullable.HasValue)
            {
                double angleMin = AngleMinNullable.Value;
                double angleMax = AngleMaxNullable.Value;
                if (!MoreMath.IsAngleBetweenAngles(angle, angleMin, angleMax))
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #2
0
        public List <CoinTrajectory> CalculateCoinTrajectories(int rngIndex)
        {
            List <CoinTrajectory> coinTrajectories = new List <CoinTrajectory>();

            for (int i = 0; i < NumCoins; i++)
            {
                CoinTrajectory coinTrajectory = CalculateCoinTrajectory(rngIndex + 3 * i);
                coinTrajectories.Add(coinTrajectory);
            }
            return(coinTrajectories);
        }