Beispiel #1
0
        public List <int> FindKeyHandFrames()
        {
            List <int> pendulumAnglesForDust = new List <int>()
            {
                -103861, -37756, 26919, 93440,
            };
            List <int> output = new List <int>();

            TtcPendulum pendulum         = GetClosePendulum();
            int         initialAmplitude = pendulum.GetAmplitude();

            int frame = _startingFrame;

            for (int counter = 0; true; counter++)
            {
                frame++;
                foreach (TtcObject rngObject in _rngObjects)
                {
                    rngObject.SetFrame(frame);
                    rngObject.Update();
                }

                if (pendulumAnglesForDust.Contains(pendulum._angle))
                {
                    output.Add(frame);
                }

                if (pendulum.GetAmplitude() != initialAmplitude)
                {
                    output.Add(frame);
                    if (output.Count != 5)
                    {
                        throw new ArgumentOutOfRangeException();
                    }
                    return(output);
                }
            }
        }
Beispiel #2
0
        public void FindMovingBarManipulationGivenDustFrames(List <int> dustFrames)
        {
            int limit = 1000;

            TtcPendulum closePendulum = GetClosePendulum();
            TtcPendulum farPendulum   = GetFarPendulum();

            int maxDustFrame = dustFrames.Count == 0 ? 0 : dustFrames.Max();
            int counter      = 0;
            int frame        = _startingFrame;

            while (frame < _startingFrame + limit)
            {
                counter++;
                frame++;
                foreach (TtcObject rngObject in _rngObjects)
                {
                    rngObject.SetFrame(frame);
                    rngObject.Update();
                }

                if (frame > maxDustFrame &&
                    farPendulum._accelerationDirection == -1 &&
                    farPendulum._accelerationMagnitude == 13 &&
                    farPendulum._angularVelocity == 0 &&
                    farPendulum._waitingTimer == 0 &&
                    farPendulum._angle == 34440)
                {
                    TtcSimulation simulation = new TtcSimulation(GetSaveState(), frame, new List <int>());
                    simulation.FindMovingBarManipulationGivenFrame1(dustFrames, frame);
                }

                (int, int)? closePair = TableConfig.PendulumSwings.GetPendulumSwingIndexExtendedPair(closePendulum.GetAmplitude());
                (int, int)? farPair   = TableConfig.PendulumSwings.GetPendulumSwingIndexExtendedPair(farPendulum.GetAmplitude());
                if (!closePair.HasValue || !farPair.HasValue)
                {
                    return;
                }
                (int c1, int c2) = closePair.Value;
                (int f1, int f2) = farPair.Value;
                if (c1 != 306)
                {
                    return;
                }
                if (f1 != 310)
                {
                    return;
                }
            }
        }