2013-10-28 20:57:25 +00:00
|
|
|
|
using System.Collections.Generic;
|
2013-10-28 19:13:01 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.Client.Common
|
|
|
|
|
{
|
|
|
|
|
public class LuaFunctionList : List<NamedLuaFunction>
|
|
|
|
|
{
|
|
|
|
|
public NamedLuaFunction this[string guid]
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2013-12-30 01:58:44 +00:00
|
|
|
|
return this.FirstOrDefault(x => x.Guid.ToString() == guid);
|
2013-10-28 19:13:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-11-10 19:19:58 +00:00
|
|
|
|
|
2013-12-19 01:02:50 +00:00
|
|
|
|
public new bool Remove(NamedLuaFunction function)
|
2013-11-10 19:19:58 +00:00
|
|
|
|
{
|
|
|
|
|
Global.Emulator.CoreComm.InputCallback.Remove(function.Callback);
|
2013-11-10 21:56:02 +00:00
|
|
|
|
Global.Emulator.CoreComm.MemoryCallbackSystem.Remove(function.Callback);
|
2013-12-19 01:02:50 +00:00
|
|
|
|
return base.Remove(function);
|
2013-11-10 19:19:58 +00:00
|
|
|
|
}
|
2013-11-10 21:56:02 +00:00
|
|
|
|
|
|
|
|
|
public void ClearAll()
|
|
|
|
|
{
|
|
|
|
|
Global.Emulator.CoreComm.InputCallback.RemoveAll(this.Select(x => x.Callback));
|
|
|
|
|
Global.Emulator.CoreComm.MemoryCallbackSystem.RemoveAll(this.Select(x => x.Callback));
|
|
|
|
|
Clear();
|
|
|
|
|
}
|
2013-10-28 19:13:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|