-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJanitor.cs
42 lines (36 loc) · 1.69 KB
/
Janitor.cs
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
using Roblox;
namespace JanitorModule
{
public interface IDestroyable {
void Destroy();
}
public interface IDisconnectable {
void Disconnect();
}
public class Janitor : Janitor<string>
{
}
public class Janitor<I> where I : notnull
{
public bool CurrentlyCleaning { get; }
public bool SuppressInstanceReDestroy { get; set; }
public static extern bool Is(object obj);
public extern IDisconnectable Add(IDisconnectable obj, string? methodName = null, I? index = default);
public extern IDestroyable Add(IDestroyable obj, string? methodName = null, I? index = default);
public extern Action Add(Action obj, string? methodName = null, I? index = default);
public extern object Add(object obj, string? methodName = null, I? index = default);
public extern object AddObject(Type obj, string? methodName = null, I? index = default);
public extern T AddObject<T>(Type obj, string? methodName = null, I? index = default) where T : notnull;
public extern Janitor Remove(I index);
public extern Janitor RemoveNoClean(I index);
public extern Janitor RemoveList(params I[] indices);
public extern Janitor RemoveListNoClean(params I[] indices);
public extern object? Get(I index);
public extern T? Get<T>(I index) where T : notnull;
public extern IDictionary<I, T> GetAll<T>() where T : notnull;
public extern void Cleanup();
public extern void Destroy();
public extern ScriptConnection LinkToInstance(Instance instance, bool allowMultiple);
public extern Janitor LinkToInstances(params Instance[] instances);
}
}