forked from MrOkiDoki/BattleBit-Community-Server-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRESTQueue.cs
More file actions
44 lines (33 loc) · 927 Bytes
/
RESTQueue.cs
File metadata and controls
44 lines (33 loc) · 927 Bytes
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
using System.Collections.Concurrent;
using System.Numerics;
using BattleBitAPI.Common;
namespace CommunityServerAPI;
public class Command
{
public ActionType Action { get; set; }
public ulong StreamerId { get; set; }
public int Amount { get; set; }
public Vector3 Location { get; set; }
public IEnumerable<string> Data { get; set; }
public string ExecutorName { get; set; }
public List<Attachment> AttachmentChange { get; set; }
public List<Weapon> WeaponChange { get; set; }
public List<Gadget> GadgetChange { get; set; }
}
public class CommandQueue
{
private readonly ConcurrentQueue<Command> _queue = new();
public void Enqueue(Command command)
{
_queue.Enqueue(command);
}
public Command Dequeue()
{
_queue.TryDequeue(out var command);
return command;
}
public bool IsEmpty()
{
return _queue.IsEmpty;
}
}