Repository navigation
Expand file tree
/
Copy pathIConsoleConnection.cs
More file actions
74 lines (63 loc) · 2.61 KB
/
Copy pathIConsoleConnection.cs
File metadata and controls
74 lines (63 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
namespace SysBot.Base
{
/// <summary>
/// Concepts and properties to describe a connection with a console, without explicitly interacting with it.
/// </summary>
public interface IConsoleConnection
{
/// <summary>
/// Internal differentiation for the Bot
/// </summary>
string Name { get; }
/// <summary>
/// Customized Label for the bot (potentially based on in-game values).
/// </summary>
string Label { get; set; }
/// <summary>
/// Connects to the device.
/// </summary>
void Connect();
/// <summary>
/// Resets the connection to the device, usually by calling <see cref="Disconnect"/> then <see cref="Connect"/> in a clean manner.
/// </summary>
void Reset();
/// <summary>
/// Disconnects from the device.
/// </summary>
void Disconnect();
/// <summary>
/// Indicates if the device is currently connected.
/// </summary>
/// <remarks>Sometimes might not check the connection status, rather if it has been called to <see cref="Connect"/> without <see cref="Disconnect"/> being called yet.</remarks>
bool Connected { get; }
/// <summary>
/// Logs a message for the connection.
/// </summary>
/// <param name="message">Anything you want the bot to log.</param>
abstract void Log(string message);
/// <summary>
/// Logs an information message for the connection.
/// </summary>
/// <param name="message"></param>
abstract void LogInfo(string message);
/// <summary>
/// Logs an error message for the connection.
/// </summary>
/// <param name="message"></param>
abstract void LogError(string message);
/// <summary>
/// Maximum amount of data to be sent in a single packet to the device.
/// </summary>
/// <remarks>Whenever the amount of data to be sent exceeds this amount, the data payload is split into smaller chunks.</remarks>
int MaximumTransferSize { get; set; }
/// <summary>
/// Base amount of time (in milliseconds) to wait when sending successive commands.
/// </summary>
int BaseDelay { get; set; }
/// <summary>
/// Slows down the communication for successive commands by dividing the packet length to get a delay (in milliseconds).
/// </summary>
/// <remarks>Set this value >= the <see cref="MaximumTransferSize"/> to result in 0 bonus delay.</remarks>
int DelayFactor { get; set; }
}
}