-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lookup.cs
41 lines (24 loc) · 1.7 KB
/
Lookup.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
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.Party;
using TaleWorlds.CampaignSystem.Settlements;
namespace Int19h.Bannerlord.CSharp.Scripting {
public abstract class Lookup {
public abstract string What { get; }
public abstract bool Matches<T>(T x);
public static implicit operator Lookup(string s) => new NameLookup(s);
public static implicit operator Kingdom(Lookup lookup) => ScriptGlobals.Kingdoms[lookup];
public static implicit operator Kingdom[](Lookup lookup) => new[] { (Kingdom)lookup };
public static implicit operator Clan(Lookup lookup) => ScriptGlobals.Clans[lookup];
public static implicit operator Clan[](Lookup lookup) => new[] { (Clan)lookup };
public static implicit operator Hero(Lookup lookup) => ScriptGlobals.Heroes[lookup];
public static implicit operator Hero[](Lookup lookup) => new[] { (Hero)lookup };
public static implicit operator Settlement(Lookup lookup) => ScriptGlobals.Settlements[lookup];
public static implicit operator Settlement[](Lookup lookup) => new[] { (Settlement)lookup };
public static implicit operator Town(Lookup lookup) => ScriptGlobals.Fiefs[lookup];
public static implicit operator Town[](Lookup lookup) => new[] { (Town)lookup };
public static implicit operator Village(Lookup lookup) => ScriptGlobals.Villages[lookup];
public static implicit operator Village[](Lookup lookup) => new[] { (Village)lookup };
public static implicit operator MobileParty(Lookup lookup) => ScriptGlobals.Parties[lookup];
public static implicit operator MobileParty[](Lookup lookup) => new[] { (MobileParty)lookup };
}
}