forked from FabianTerhorst/coreclr-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAltAsync.WorldObject.cs
More file actions
39 lines (32 loc) · 1.83 KB
/
AltAsync.WorldObject.cs
File metadata and controls
39 lines (32 loc) · 1.83 KB
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
using System;
using System.Threading.Tasks;
using AltV.Net.Data;
using AltV.Net.Elements.Entities;
namespace AltV.Net.Async
{
//TODO: allocate position, rotation, rgba structs in task thread an pass them to the main thread instead of creating them in the main thread
public partial class AltAsync
{
[Obsolete("Use async entities instead")]
public static Task SetPositionAsync(this IWorldObject worldObject, Position position) =>
AltVAsync.Schedule(() => worldObject.Position = position);
[Obsolete("Use async entities instead")]
public static Task SetPositionAsync(this IWorldObject worldObject, float x, float y, float z) =>
AltVAsync.Schedule(() => worldObject.SetPosition(x, y, z));
[Obsolete("Use async entities instead")]
public static Task SetPositionAsync(this IWorldObject worldObject, (float X, float Y, float Z) position) =>
AltVAsync.Schedule(() => worldObject.SetPosition(position));
[Obsolete("Use async entities instead")]
public static Task<Position> GetPositionAsync(this IWorldObject worldObject) =>
AltVAsync.Schedule(() => worldObject.Position);
[Obsolete("Use async entities instead")]
public static Task<(float X, float Y, float Z)> GetPositionTupleAsync(this IWorldObject worldObject) =>
AltVAsync.Schedule(worldObject.GetPosition);
[Obsolete("Use async entities instead")]
public static Task SetDimensionAsync(this IWorldObject worldObject, int dimension) =>
AltVAsync.Schedule(() => worldObject.Dimension = dimension);
[Obsolete("Use async entities instead")]
public static Task<int> GetDimensionAsync(this IWorldObject worldObject) =>
AltVAsync.Schedule(() => worldObject.Dimension);
}
}