-
Notifications
You must be signed in to change notification settings - Fork 70
/
AltAsync.ToAsync.cs
95 lines (77 loc) · 4.04 KB
/
AltAsync.ToAsync.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System;
using AltV.Net.Async.Elements.Entities;
using AltV.Net.Elements.Entities;
namespace AltV.Net.Async
{
public static partial class AltAsync
{
[Obsolete("Use new async API instead")]
public static IPlayer ToAsync(this IPlayer player, IAsyncContext asyncContext) =>
asyncContext == null ? new AsyncPlayer(player, asyncContext) : null;
[Obsolete("Use new async API instead")]
public static IVehicle ToAsync(this IVehicle vehicle, IAsyncContext asyncContext) =>
asyncContext == null ? new AsyncVehicle(vehicle, asyncContext) : null;
[Obsolete("Use new async API instead")]
public static ICheckpoint ToAsync(this ICheckpoint checkpoint, IAsyncContext asyncContext) =>
asyncContext == null ? new AsyncCheckpoint(checkpoint, asyncContext) : null;
[Obsolete("Use new async API instead")]
public static IColShape ToAsync(this IColShape colShape, IAsyncContext asyncContext) =>
asyncContext == null ? new AsyncColShape(colShape, asyncContext) : null;
[Obsolete("Use new async API instead")]
public static IBlip ToAsync(this IBlip blip, IAsyncContext asyncContext) =>
asyncContext == null ? new AsyncBlip(blip, asyncContext) : null;
[Obsolete("Use new async API instead")]
public static IVoiceChannel ToAsync(this IVoiceChannel voiceChannel, IAsyncContext asyncContext) =>
asyncContext == null ? new AsyncVoiceChannel(voiceChannel, asyncContext) : null;
[Obsolete("Use new async API instead")]
public static IPlayer ToAsync(this IPlayer player) => new AsyncPlayer(player, null);
[Obsolete("Use new async API instead")]
public static IVehicle ToAsync(this IVehicle vehicle) => new AsyncVehicle(vehicle, null);
[Obsolete("Use new async API instead")]
public static ICheckpoint ToAsync(this ICheckpoint checkpoint) => new AsyncCheckpoint(checkpoint, null);
[Obsolete("Use new async API instead")]
public static IColShape ToAsync(this IColShape colShape) => new AsyncColShape(colShape, null);
[Obsolete("Use new async API instead")]
public static IBlip ToAsync(this IBlip blip) => new AsyncBlip(blip, null);
[Obsolete("Use new async API instead")]
public static IVoiceChannel ToAsync(this IVoiceChannel voiceChannel) => new AsyncVoiceChannel(voiceChannel, null);
[Obsolete("Use new async API instead")]
public static bool TryToAsync(this IPlayer thisValue, IAsyncContext asyncContext, out IPlayer player)
{
player = new AsyncPlayer(thisValue, asyncContext);
return true;
}
[Obsolete("Use new async API instead")]
public static bool TryToAsync(this IVehicle thisValue, IAsyncContext asyncContext, out IVehicle vehicle)
{
vehicle = new AsyncVehicle(thisValue, asyncContext);
return true;
}
[Obsolete("Use new async API instead")]
public static bool TryToAsync(this ICheckpoint thisValue, IAsyncContext asyncContext,
out ICheckpoint checkpoint)
{
checkpoint = new AsyncCheckpoint(thisValue, asyncContext);
return true;
}
[Obsolete("Use new async API instead")]
public static bool TryToAsync(this IColShape thisValue, IAsyncContext asyncContext, out IColShape colShape)
{
colShape = new AsyncColShape(thisValue, asyncContext);
return true;
}
[Obsolete("Use new async API instead")]
public static bool TryToAsync(this IBlip thisValue, IAsyncContext asyncContext, out IBlip blip)
{
blip = new AsyncBlip(thisValue, asyncContext);
return true;
}
[Obsolete("Use new async API instead")]
public static bool TryToAsync(this IVoiceChannel thisValue, IAsyncContext asyncContext,
out IVoiceChannel voiceChannel)
{
voiceChannel = new AsyncVoiceChannel(thisValue, asyncContext);
return true;
}
}
}