2022-07-01 12:22:31 +08:00
using RageCoop.Core.Scripting ;
namespace RageCoop.Client.Scripting
2022-05-31 02:16:12 -08:00
{
2022-05-31 19:35:01 -08:00
/// <summary>
2022-06-12 15:39:32 +08:00
/// Inherit from this class, constructor will be called automatically, but other scripts might have yet been loaded, you should use <see cref="OnStart"/>. to initiate your script.
2022-05-31 19:35:01 -08:00
/// </summary>
2022-07-01 12:22:31 +08:00
public abstract class ClientScript
2022-05-31 02:16:12 -08:00
{
2022-06-12 15:39:32 +08:00
/// <summary>
/// This method would be called from main thread shortly after all scripts have been loaded.
/// </summary>
2022-07-01 12:22:31 +08:00
public abstract void OnStart ( ) ;
2022-06-12 15:39:32 +08:00
/// <summary>
/// This method would be called from main thread when the client disconnected from the server, you MUST terminate all background jobs/threads in this method.
/// </summary>
2022-07-01 12:22:31 +08:00
public abstract void OnStop ( ) ;
/// <summary>
/// Get the <see cref="ResourceFile"/> instance where this script is loaded from.
/// </summary>
public ResourceFile CurrentFile { get ; internal set ; }
2022-06-12 15:39:32 +08:00
2022-07-02 11:23:12 +08:00
/// <summary>
/// Get the <see cref="ClientResource"/> that this script belongs to.
/// </summary>
public ClientResource CurrentResource { get ; internal set ; }
2022-05-31 02:16:12 -08:00
}
}