simplify the InputCallbackSystem object

This commit is contained in:
adelikat 2014-08-13 01:43:28 +00:00
parent d729403cca
commit e9110be6ff
1 changed files with 5 additions and 20 deletions

View File

@ -118,43 +118,28 @@ namespace BizHawk.Emulation.Common
private bool logging;
}
public class InputCallbackSystem
public class InputCallbackSystem : List<Action>
{
private readonly List<Action> _list = new List<Action>();
public void Add(Action action)
{
_list.Add(action);
}
public void Call()
{
foreach (var action in _list)
foreach (var action in this)
{
action();
}
}
public void Remove(Action action)
{
_list.Remove(action);
}
public void RemoveAll(IEnumerable<Action> actions)
{
foreach (var action in actions)
{
_list.Remove(action);
this.Remove(action);
}
}
public void Clear()
public bool Has
{
_list.Clear();
get { return this.Any(); }
}
// why was this missing?
public bool Has { get { return _list.Any(); } }
}
public class MemoryCallbackSystem