simplify the InputCallbackSystem object
This commit is contained in:
parent
d729403cca
commit
e9110be6ff
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue