-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
AltAsync.Checkpoint.cs
53 lines (42 loc) · 2.37 KB
/
AltAsync.Checkpoint.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 System.Threading.Tasks;
using AltV.Net.Data;
using AltV.Net.Elements.Entities;
namespace AltV.Net.Async
{
public static partial class AltAsync
{
public static Task<ICheckpoint> CreateCheckpoint(byte type, Position pos, float radius,
float height,
Rgba color, uint streamingDistance) =>
AltVAsync.Schedule(() => Alt.CreateCheckpoint(type, pos, radius, height, color, streamingDistance));
public static Task<ICheckpoint> CreateCheckpoint(CheckpointType type, Position pos, float radius,
float height,
Rgba color, uint streamingDistance) =>
AltVAsync.Schedule(() => Alt.CreateCheckpoint(type, pos, radius, height, color, streamingDistance));
[Obsolete("Use async entities instead")]
public static Task<CheckpointType> GetCheckpointTypeAsync(this ICheckpoint checkpoint) =>
AltVAsync.Schedule(() => (CheckpointType) checkpoint.CheckpointType);
[Obsolete("Use async entities instead")]
public static Task<float> GetHeightAsync(this ICheckpoint checkpoint) =>
AltVAsync.Schedule(() => checkpoint.Height);
[Obsolete("Use async entities instead")]
public static Task<float> GetRadiusAsync(this ICheckpoint checkpoint) =>
AltVAsync.Schedule(() => checkpoint.Radius);
[Obsolete("Use async entities instead")]
public static Task<Rgba> GetColorAsync(this ICheckpoint checkpoint) =>
AltVAsync.Schedule(() => checkpoint.Color);
[Obsolete("Use Checkpoint.IsEntityIn on async entity instead")]
public static Task<bool> IsPlayerInAsync(this ICheckpoint checkpoint, IPlayer player) =>
AltVAsync.Schedule(() => checkpoint.IsPlayerIn(player));
[Obsolete("Use Checkpoint.IsEntityIn on async entity instead")]
public static Task<bool> IsVehicleInAsync(this ICheckpoint checkpoint, IVehicle vehicle) =>
AltVAsync.Schedule(() => checkpoint.IsVehicleIn(vehicle));
[Obsolete("Use async entities instead")]
public static Task<bool> IsEntityInAsync(this ICheckpoint checkpoint, IEntity entity) =>
AltVAsync.Schedule(() => checkpoint.IsEntityIn(entity));
[Obsolete("Use async entities instead")]
public static Task DestroyAsync(this ICheckpoint checkpoint) =>
AltVAsync.Schedule(checkpoint.Destroy);
}
}