コード例 #1
0
ファイル: DelayTimer.cs プロジェクト: PMArkive/eontimer
        public DelayTimer(Int32 calibration, Int32 targetDelay, Int32 targetSecond, Consoles.ConsoleType consoleType, Int32 minLength, Boolean initialize = true)
            : base(calibration, targetSecond, consoleType, minLength, false)
        {
            TargetDelay = targetDelay;

            if (initialize)
            {
                Initialize();
            }
        }
コード例 #2
0
        public SimpleTimer(Int32 calibration, Int32 targetSecond, Consoles.ConsoleType consoleType, Int32 minLength, Boolean initialize = true)
        {
            Calibration   = calibration;
            TargetSecond  = targetSecond;
            ConsoleType   = consoleType;
            MinimumLength = minLength;

            if (initialize)
            {
                Initialize();
            }
        }
コード例 #3
0
        public FrameTimer(Int32 calibration, Int32 pretimer, Int32 targetFrame, Consoles.ConsoleType consoleType)
        {
            Calibration    = calibration;
            PretimerLength = pretimer;
            TargetFrame    = targetFrame;
            ConsoleType    = consoleType;

            Stages = new List <TimeSpan>();
            for (Int32 i = 0; GetStage(i) != TimerConstants.NULL_TIMESPAN; i++)
            {
                Stages.Add(GetStage(i));
            }
        }
コード例 #4
0
        /// <summary>
        /// Converts milliseconds to delays
        /// </summary>
        /// <param name="millis">Milliseconds to be converted</param>
        /// <param name="type">The console type</param>
        /// <returns>Delays</returns>
        public static Int32 ConvertToDelays(Int32 millis, Consoles.ConsoleType type)
        {
            switch (type)
            {
            case Consoles.ConsoleType.GBA:
                return((Int32)Math.Round(millis / TimerConstants.FRAMERATE_GBA));

            case Consoles.ConsoleType.NDS:
                return((Int32)Math.Round(millis / TimerConstants.FRAMERATE_NDS));

            case Consoles.ConsoleType.DSI:
                return((Int32)Math.Round(millis / TimerConstants.FRAMERATE_DSI));

            case Consoles.ConsoleType._3DS:
                return((Int32)Math.Round(millis / TimerConstants.FRAMERATE_3DS));

            default:
                return(0);
            }
        }
コード例 #5
0
        public EnhancedEntralinkTimer(Int32 calibration, Int32 secondaryCalibration, Int32 targetDelay, Int32 targetSecond, Int32 targetFrame, Int32 frameCalibration, Consoles.ConsoleType consoleType, Int32 minLength, Boolean initialize = true)
            : base(calibration, secondaryCalibration, targetDelay, targetSecond, consoleType, minLength, false)
        {
            TargetFrame      = targetFrame;
            NPCCount         = 0;
            InitialAdvances  = 0;
            FrameCalibration = frameCalibration;

            if (initialize)
            {
                Initialize();
            }
        }
コード例 #6
0
 public VariableTargetFrameTimer(Consoles.ConsoleType consoleType)
 {
     ConsoleType = consoleType;
     TargetFrame = -1;
     PrepareStages();
 }
コード例 #7
0
        public static Int32 CreateCalibration(Int32 delay, Int32 second, Consoles.ConsoleType type)
        {
            var delayCalibration = delay - ConvertToDelays(second * 1000, type);

            return(ConvertToMillis(delayCalibration, type));
        }
コード例 #8
0
ファイル: EntralinkTimer.cs プロジェクト: PMArkive/eontimer
        public EntralinkTimer(Int32 calibration, Int32 secondaryCalibration, Int32 targetDelay, Int32 targetSecond, Consoles.ConsoleType consoleType, Int32 minLength, Boolean initialize = true)
            : base(calibration, targetDelay, targetSecond, consoleType, minLength, false)
        {
            SecondaryCalibration = secondaryCalibration;

            if (initialize)
            {
                Initialize();
            }
        }