예제 #1
0
        public int BranchIndexByHash(Guid uuid)
        {
            TasBranch branch = Branches.SingleOrDefault(b => b.UniqueIdentifier == uuid);

            if (branch == null)
            {
                return(-1);
            }

            return(Branches.IndexOf(branch));
        }
예제 #2
0
        public int BranchIndexByFrame(int frame)
        {
            TasBranch branch = Branches.Where(b => b.Frame == frame)
                               .OrderByDescending(b => b.TimeStamp).FirstOrDefault();

            if (branch == null)
            {
                return(-1);
            }
            return(Branches.IndexOf(branch));
        }
예제 #3
0
        public int BranchIndexByHash(int hash)
        {
            TasBranch branch = Branches.SingleOrDefault(b => b.UniqueIdentifier.GetHashCode() == hash);

            if (branch == null)
            {
                return(-1);
            }

            return(Branches.IndexOf(branch));
        }
예제 #4
0
        public void SwapBranches(int b1, int b2)
        {
            TasBranch branch = Branches[b1];

            if (b2 >= Branches.Count)
            {
                b2 = Branches.Count - 1;
            }

            Branches.Remove(branch);
            Branches.Insert(b2, branch);
        }
예제 #5
0
        public void UpdateBranch(TasBranch old, TasBranch newBranch)
        {
            int index = Branches.IndexOf(old);

            newBranch.UniqueIdentifier = old.UniqueIdentifier;
            if (newBranch.UserText == "")
            {
                newBranch.UserText = old.UserText;
            }

            Branches[index] = newBranch;
            Changes         = true;
        }
예제 #6
0
파일: TasMovie.cs 프로젝트: lenalia/BizHawk
        public TasBranch GetBranch(Guid id)
        {
            TasBranch branch = Branches.Where(b => b.UniqueIdentifier == id).SingleOrDefault();

            if (branch != null)
            {
                return(branch);
            }
            else
            {
                return(null);
            }
        }
예제 #7
0
        public void LoadBranch(TasBranch branch)
        {
            int?divergentPoint = DivergantPoint(_log, branch.InputLog);

            _log     = branch.InputLog.ToList();
            _changes = true;
            LagLog.FromLagLog(branch.LagLog);

            StateManager.LoadBranch(Branches.IndexOf(branch));

            StateManager.SetState(branch.Frame, branch.CoreData);

            ChangeLog = branch.ChangeLog;
            Markers   = branch.Markers;
        }
예제 #8
0
        public void LoadBranch(TasBranch branch)
        {
            int?divergentPoint = DivergentPoint(Log, branch.InputLog);

            Log?.Dispose();
            Log = branch.InputLog.Clone();

            InvalidateAfter(divergentPoint ?? branch.InputLog.Count);

            if (BindMarkersToInput)             // pretty critical not to erase them
            {
                Markers = branch.Markers;
            }

            Changes = true;
        }
예제 #9
0
 public void RemoveBranch(TasBranch branch)
 {
     Branches.Remove(branch);
     Changes = true;
 }
예제 #10
0
 public void AddBranch(TasBranch branch)
 {
     Branches.Add(branch);
     Changes = true;
 }
예제 #11
0
 public void RemoveBranch(TasBranch branch)
 {
     TasStateManager.RemoveBranch(Branches.IndexOf(branch));
     Branches.Remove(branch);
     Changes = true;
 }
예제 #12
0
 public void AddBranch(TasBranch branch)
 {
     Branches.Add(branch);
     TasStateManager.AddBranch();
     Changes = true;
 }
예제 #13
0
 public void AddBranch(TasBranch branch)
 {
     Branches.Add(branch);
     TasStateManager.AddBranch();
 }