Beispiel #1
0
 public TasMovieRecord this[int index] => new TasMovieRecord
 {
     // State = StateManager[index],
     HasState  = _stateManager.HasState(index),
     LogEntry  = GetInputLogEntry(index),
     Lagged    = _lagLog[index + 1],
     WasLagged = _lagLog.History(index + 1)
 };
Beispiel #2
0
 public TasMovieRecord this[int index] {
     get { return(new TasMovieRecord {
             // State = StateManager[index],
             HasState = StateManager.HasState(index),
             LogEntry = GetInputLogEntry(index),
             Lagged = LagLog[index + 1],
             WasLagged = LagLog.History(index + 1)
         }); }
 }
Beispiel #3
0
        // TODO: try not to need this, or at least use GetInputState and then a log entry generator
        public string GetInputLogEntry(int frame)
        {
            if (Global.Emulator.Frame == frame && !StateManager.HasState(frame))
            {
                StateManager.Capture();
            }

            if (Global.Emulator.Frame == frame && frame >= LagLog.Count)
            {
                LagLog.Add(Global.Emulator.IsLagFrame);
            }

            if (frame < FrameCount && frame >= 0)
            {
                int getframe;

                if (LoopOffset.HasValue)
                {
                    if (frame < _log.Count)
                    {
                        getframe = frame;
                    }
                    else
                    {
                        getframe = ((frame - LoopOffset.Value) % (_log.Count - LoopOffset.Value)) + LoopOffset.Value;
                    }
                }
                else
                {
                    getframe = frame;
                }

                return(_log[getframe]);
            }

            return(string.Empty);
        }