1 |
using System; |
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Diagnostics; |
6 |
using RomCheater.PluginFramework.Core; |
7 |
using RomCheater.PluginFramework.Events; |
8 |
|
9 |
namespace RomCheater.PluginFramework.Interfaces |
10 |
{ |
11 |
#region IPluginBase |
12 |
public interface IPluginBase : IPluginName, IPluginDescription, IPluginID, IToString, IPluginRefresh { } |
13 |
#region IPluginBase SubMembers |
14 |
public interface IToString { string ToString(); } |
15 |
public interface IPluginName { string Name { get; } } |
16 |
public interface IPluginDescription { string Description { get; } } |
17 |
public interface IPluginID { Guid ID { get; } } |
18 |
public interface IPluginRefresh { void Reload(); void Reload(bool silent); } |
19 |
#endregion |
20 |
#endregion |
21 |
#region IConfigPlugin |
22 |
public interface IConfigPlugin : IPluginBase, IAcceptsReadOnlyMemoryRange, ISearchInProgress, IAcceptsMemorySearch |
23 |
{ |
24 |
List<ProcContainer> ValidProcessesForPlugin { get; } |
25 |
} |
26 |
#endregion |
27 |
#region IInputPlugin |
28 |
public interface IInputPlugin : IPluginBase |
29 |
{ |
30 |
} |
31 |
#endregion |
32 |
#region IWindowPlugin |
33 |
public interface IWindowPlugin : IPluginBase |
34 |
{ |
35 |
} |
36 |
#endregion |
37 |
#region IPluginLoader |
38 |
public interface IPluginLoader |
39 |
{ |
40 |
void LoadPlugins(); |
41 |
void LoadPlugins(bool silent); |
42 |
List<IConfigPlugin> LoadedConfigPlugins { get; } |
43 |
List<IInputPlugin> LoadedInputPlugins { get; } |
44 |
List<IWindowPlugin> LoadedWindowPlugins { get; } |
45 |
|
46 |
IConfigPlugin GetConfigPlugin(string t); |
47 |
IInputPlugin GetInputPlugin(string t); |
48 |
IWindowPlugin GetWindowPlugin(string t); |
49 |
|
50 |
string ToString(); |
51 |
} |
52 |
#endregion |
53 |
#region AcceptsPlugin |
54 |
public interface IAcceptsPlugin<TPlugin> |
55 |
where TPlugin : IPluginBase |
56 |
{ |
57 |
TPlugin AcceptedPlugin { get; set; } |
58 |
} |
59 |
public interface IAcceptsConfig : IAcceptsPlugin<IConfigPlugin> { } |
60 |
public interface IAcceptsProcess : IAcceptsProcess<Process> { } |
61 |
public interface IAcceptsProcess<TProcess> |
62 |
where TProcess : Process |
63 |
{ |
64 |
TProcess AcceptedProcess { get; set; } |
65 |
} |
66 |
#endregion |
67 |
public interface IAcceptsProcessAndConfig<TProcess> : IAcceptsConfig, IAcceptsProcess<TProcess> where TProcess : Process { } |
68 |
public interface IAcceptsProcessAndConfig : IAcceptsProcess, IAcceptsConfig { } |
69 |
|
70 |
public class AcceptedProcessAndConfig<TProcess> : IAcceptsProcessAndConfig<TProcess> where TProcess : Process |
71 |
{ |
72 |
public AcceptedProcessAndConfig() : this(null, default(TProcess)) { } |
73 |
public AcceptedProcessAndConfig(IConfigPlugin config, TProcess process) { AcceptedPlugin = config; AcceptedProcess = process; } |
74 |
#region IAcceptsProcessAndConfig<TProcess> members |
75 |
#endregion |
76 |
|
77 |
#region IAcceptsPlugin<IConfigPlugin> Members |
78 |
public IConfigPlugin AcceptedPlugin { get; set; } |
79 |
#endregion |
80 |
|
81 |
#region IAcceptsProcess<TProcess> Members |
82 |
public TProcess AcceptedProcess { get; set; } |
83 |
#endregion |
84 |
} |
85 |
public class AcceptedProcessAndConfig : IAcceptsProcessAndConfig |
86 |
{ |
87 |
public AcceptedProcessAndConfig() : this(null, null) { } |
88 |
public AcceptedProcessAndConfig(IConfigPlugin config, Process process) { AcceptedPlugin = config; AcceptedProcess = process; } |
89 |
|
90 |
#region IAcceptsProcess<Process> Members |
91 |
public Process AcceptedProcess { get; set; } |
92 |
#endregion |
93 |
#region IAcceptsPlugin<IConfigPlugin> Members |
94 |
public IConfigPlugin AcceptedPlugin { get; set; } |
95 |
#endregion |
96 |
} |
97 |
|
98 |
public interface IAcceptsProcessPID |
99 |
{ |
100 |
int ProcessPID { get; set; } |
101 |
} |
102 |
public interface IAcceptsMemoryRange |
103 |
{ |
104 |
uint MemoryRangeStart { get; set; } |
105 |
uint MemoryRangeSize { get; set; } |
106 |
} |
107 |
public interface IAcceptsReadOnlyMemoryRange |
108 |
{ |
109 |
uint MemoryRangeStart { get; } |
110 |
uint MemoryRangeSize { get; } |
111 |
} |
112 |
public interface IOutputsData<TData> { TData Data { get; } } |
113 |
public interface ISearchInProgress { bool SearchInProgess { get; } } |
114 |
} |