forked from MrOkiDoki/BattleBit-Community-Server-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtility.cs
More file actions
45 lines (38 loc) · 1.13 KB
/
Utility.cs
File metadata and controls
45 lines (38 loc) · 1.13 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
40
41
42
43
44
45
using BattleBitAPI.Common;
namespace BattleBitAPI.Server;
public class Utility
{
public static List<Attachment> ParseAttachments(string[] splits)
{
var attachments = new List<Attachment>();
var s = splits.Skip(3);
foreach (var st in s)
if (Attachments.TryFind(st, out var attach))
attachments.Add(attach);
else
attachments.Add(default);
return attachments;
}
public static List<Weapon> ParseWeapons(string[] splits)
{
var weapons = new List<Weapon>();
var s = splits.Skip(3);
foreach (var st in s)
if (Weapons.TryFind(st, out var weapon))
weapons.Add(weapon);
else
weapons.Add(default);
return weapons;
}
public static List<Gadget> ParseGadgets(string[] splits)
{
var gadgets = new List<Gadget>();
var s = splits.Skip(3);
foreach (var st in s)
if (Gadgets.TryFind(st, out var gadget))
gadgets.Add(gadget);
else
gadgets.Add(default);
return gadgets;
}
}