|
1 | | -using System; |
| 1 | +using System; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Linq; |
4 | 4 | using System.Text; |
|
8 | 8 |
|
9 | 9 | namespace Torch.API |
10 | 10 | { |
| 11 | + /// <summary> |
| 12 | + /// API for Torch functions shared between client and server. |
| 13 | + /// </summary> |
11 | 14 | public interface ITorchBase |
12 | 15 | { |
| 16 | + /// <summary> |
| 17 | + /// Fired when the session begins loading. |
| 18 | + /// </summary> |
13 | 19 | event Action SessionLoading; |
| 20 | + |
| 21 | + /// <summary> |
| 22 | + /// Fired when the session finishes loading. |
| 23 | + /// </summary> |
14 | 24 | event Action SessionLoaded; |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// Fires when the session begins unloading. |
| 28 | + /// </summary> |
15 | 29 | event Action SessionUnloading; |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// Fired when the session finishes unloading. |
| 33 | + /// </summary> |
16 | 34 | event Action SessionUnloaded; |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// Configuration for the current instance. |
| 38 | + /// </summary> |
17 | 39 | ITorchConfig Config { get; } |
| 40 | + |
| 41 | + /// <inheritdoc cref="IMultiplayerManager"/> |
18 | 42 | IMultiplayerManager Multiplayer { get; } |
| 43 | + |
| 44 | + /// <inheritdoc cref="IPluginManager"/> |
19 | 45 | IPluginManager Plugins { get; } |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// The binary version of the current instance. |
| 49 | + /// </summary> |
20 | 50 | Version TorchVersion { get; } |
| 51 | + |
| 52 | + /// <summary> |
| 53 | + /// Invoke an action on the game thread. |
| 54 | + /// </summary> |
21 | 55 | void Invoke(Action action); |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// Invoke an action on the game thread and block until it has completed. |
| 59 | + /// If this is called on the game thread the action will execute immediately. |
| 60 | + /// </summary> |
22 | 61 | void InvokeBlocking(Action action); |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// Invoke an action on the game thread asynchronously. |
| 65 | + /// </summary> |
23 | 66 | Task InvokeAsync(Action action); |
24 | | - string[] RunArgs { get; set; } |
25 | | - bool IsOnGameThread(); |
| 67 | + |
| 68 | + /// <summary> |
| 69 | + /// Start the Torch instance. |
| 70 | + /// </summary> |
26 | 71 | void Start(); |
| 72 | + |
| 73 | + /// <summary> |
| 74 | + /// Stop the Torch instance. |
| 75 | + /// </summary> |
27 | 76 | void Stop(); |
| 77 | + |
28 | 78 | /// <summary> |
29 | 79 | /// Initializes a save of the game. |
30 | 80 | /// </summary> |
31 | 81 | /// <param name="callerId">Id of the player who initiated the save.</param> |
32 | 82 | void Save(long callerId); |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// Initialize the Torch instance. |
| 86 | + /// </summary> |
33 | 87 | void Init(); |
| 88 | + |
| 89 | + /// <summary> |
| 90 | + /// Get an <see cref="IManager"/> that is part of the Torch instance. |
| 91 | + /// </summary> |
| 92 | + /// <typeparam name="T">Manager type</typeparam> |
34 | 93 | T GetManager<T>() where T : class, IManager; |
35 | 94 | } |
36 | 95 |
|
| 96 | + /// <summary> |
| 97 | + /// API for the Torch server. |
| 98 | + /// </summary> |
37 | 99 | public interface ITorchServer : ITorchBase |
38 | 100 | { |
| 101 | + /// <summary> |
| 102 | + /// Path of the dedicated instance folder. |
| 103 | + /// </summary> |
39 | 104 | string InstancePath { get; } |
40 | 105 | } |
41 | 106 |
|
| 107 | + /// <summary> |
| 108 | + /// API for the Torch client. |
| 109 | + /// </summary> |
42 | 110 | public interface ITorchClient : ITorchBase |
43 | 111 | { |
44 | 112 |
|
|
0 commit comments