-
Notifications
You must be signed in to change notification settings - Fork 0
/
Subraces.cs
81 lines (73 loc) · 2.91 KB
/
Subraces.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using DnD5e.Data;
namespace DnD5e
{
//<summary>
///The Subraces class, rolled up by Burrito.
///</summary>
public class Subraces
{
///<summary>
///Gets a list of subraces, given a search term (or not!).
///</summary>
public static SubraceResults SearchSubracesAsync(string name = "")
{
return BurritoCore.API.Get<SubraceResults>(_globals.RootURL + $"subraces?name={name}");
}
///<summary>
///Gets a list of subraces, given a search term (or not!).
///</summary>
public static Task SearchSubracesAsync(BurritoCore.APICallReturnDelegate<SubraceResults> callback, string name = "")
{
return BurritoCore.API.GetAsync<SubraceResults>(_globals.RootURL + $"subraces?name={name}", callback);
}
///<summary>
///Gets a subrace, given an index.
///</summary>
public static Subrace GetSubraceAsync(string index = "")
{
return BurritoCore.API.Get<Subrace>(_globals.RootURL + $"subraces/{index}");
}
///<summary>
///Gets a subrace, given an index.
///</summary>
public static Task GetSubraceAsync(BurritoCore.APICallReturnDelegate<Subrace> callback, string index = "")
{
return BurritoCore.API.GetAsync<Subrace>(_globals.RootURL + $"subraces/{index}", callback);
}
///<summary>
///Gets traits for a subrace, given an index.
///</summary>
public static SubraceTraits GetSubraceTraitsAsync(string index = "")
{
return BurritoCore.API.Get<SubraceTraits>(_globals.RootURL + $"subraces/{index}/traits");
}
///<summary>
///Gets traits for a subrace, given an index.
///</summary>
public static Task GetSubraceTraitsAsync(BurritoCore.APICallReturnDelegate<SubraceTraits> callback, string index = "")
{
return BurritoCore.API.GetAsync<SubraceTraits>(_globals.RootURL + $"subraces/{index}/traits", callback);
}
///<summary>
///Gets proficiencies for a subrace, given an index.
///</summary>
public static SubraceProficiencies GetSubraceProficienciesAsync(string index = "")
{
return BurritoCore.API.Get<SubraceProficiencies>(_globals.RootURL + $"subraces/{index}/proficiencies");
}
///<summary>
///Gets proficiencies for a subrace, given an index.
///</summary>
public static Task GetSubraceProficienciesAsync(BurritoCore.APICallReturnDelegate<SubraceProficiencies> callback, string index = "")
{
return BurritoCore.API.GetAsync<SubraceProficiencies>(_globals.RootURL + $"subraces/{index}/proficiencies", callback);
}
}
}