forked from FabianTerhorst/coreclr-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AltColShape.cs
53 lines (46 loc) · 1.46 KB
/
AltColShape.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
43
44
45
46
47
48
49
50
51
52
53
using System;
using AltV.Net.Data;
using AltV.Net.Elements.Entities;
namespace AltV.Net.ColShape
{
public static class AltColShape
{
internal static ColShapeModule Module;
public static Action<IWorldObject, IColShape> OnEntityEnterColShape
{
set => Module.OnEntityEnterColShape += value;
}
public static Action<IWorldObject, IColShape> OnEntityExitColShape
{
set => Module.OnEntityExitColShape += value;
}
/// <summary>
/// Configures the ColShape module
/// </summary>
/// <param name="options"></param>
public static void Configure(Action<ColShapeModuleOptions> options)
{
var defaultOptions = new ColShapeModuleOptions();
options(defaultOptions);
Init(new ColShapeModule(defaultOptions.AreaSize));
}
/// <summary>
/// Only use init when you know what you are doing
/// </summary>
/// <param name="module"></param>
public static void Init(ColShapeModule module)
{
Module = module;
}
public static IColShape Create(ulong id, int dimension, Position position, uint radius)
{
var colShape = new ColShape(id, dimension, position, radius);
Add(colShape);
return colShape;
}
public static void Add(IColShape colShape)
{
Module.Add(colShape);
}
}
}