Remove now obsolete HistoryCollection object, and change Text property of Ram Search (forgot to do that last commit)

This commit is contained in:
adelikat 2013-09-28 01:27:52 +00:00
parent e9f3e7afe4
commit 6e48bf1dd5
4 changed files with 3 additions and 93 deletions

View File

@ -297,7 +297,6 @@
</Compile>
<Compile Include="Global.cs" />
<Compile Include="HawkFile.cs" />
<Compile Include="HistoryCollection.cs" />
<Compile Include="Input\ControllerBinding.cs" />
<Compile Include="Input\GamePad.cs" Condition=" '$(OS)' == 'Windows_NT' " />
<Compile Include="Input\GamePad360.cs" />

View File

@ -311,7 +311,6 @@
</Compile>
<Compile Include="Global.cs" />
<Compile Include="HawkFile.cs" />
<Compile Include="HistoryCollection.cs" />
<Compile Include="Input\ControllerBinding.cs" />
<Compile Include="Input\GamePad.cs" Condition=" '$(OS)' == 'Windows_NT' " />
<Compile Include="Input\GamePad360.cs" />

View File

@ -1,88 +0,0 @@
using System.Collections.Generic;
using System.Linq;
namespace BizHawk.MultiClient
{
public class HistoryCollection
{
public List<List<Watch_Legacy>> History { get; private set; }
private int curPos; //1-based
public bool Enabled { get; private set; }
public HistoryCollection(bool enabled)
{
History = new List<List<Watch_Legacy>>();
Enabled = enabled;
}
public HistoryCollection(List<Watch_Legacy> newState, bool enabled)
{
History = new List<List<Watch_Legacy>>();
AddState(newState);
Enabled = enabled;
}
public void Clear()
{
History = new List<List<Watch_Legacy>>();
}
public bool CanUndo
{
get { return Enabled && curPos > 1; }
}
public bool CanRedo
{
get { return Enabled && curPos < History.Count; }
}
public bool HasHistory
{
get { return Enabled && History.Any(); }
}
public void AddState(List<Watch_Legacy> newState)
{
if (Enabled)
{
if (curPos < History.Count)
{
for (int i = curPos + 1; i <= History.Count; i++)
{
History.Remove(History[i - 1]);
}
}
History.Add(newState);
curPos = History.Count;
}
}
public List<Watch_Legacy> Undo()
{
if (CanUndo && Enabled)
{
curPos--;
return History[curPos - 1];
}
else
{
return null;
}
}
public List<Watch_Legacy> Redo()
{
if (CanRedo && Enabled)
{
curPos++;
return History[curPos - 1];
}
else
{
return null;
}
}
}
}

View File

@ -1294,7 +1294,7 @@
this.SearchButton.UseVisualStyleBackColor = true;
this.SearchButton.Click += new System.EventHandler(this.SearchMenuItem_Click);
//
// NewRamSearch
// RamSearch
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1313,8 +1313,8 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(291, 400);
this.Name = "NewRamSearch";
this.Text = "Brand New Experimental Ram Search";
this.Name = "RamSearch";
this.Text = "Ram Search";
this.Activated += new System.EventHandler(this.NewRamSearch_Activated);
this.Load += new System.EventHandler(this.RamSearch_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamSearch_DragDrop);