-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathArmories.cs
44 lines (38 loc) · 1.17 KB
/
Armories.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
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.Party;
namespace Bannerlord.DynamicTroop;
[Obsolete]
public class Armories {
private readonly ConcurrentDictionary<MobileParty, Armory> _armories = new();
public bool AddParty(MobileParty party) {
try { return _armories.TryAdd(party, new Armory(party)); }
catch (Exception e) {
Global.Error(e.Message);
return false;
}
}
public Armory? RemoveParty(MobileParty party) {
try { return _armories.TryRemove(party, out var armory) ? armory : null; }
catch (Exception e) {
Global.Error(e.Message);
return null;
}
}
public Armory? GetParty(MobileParty party) {
try { return _armories.TryGetValue(party, out var armory) ? armory : null; }
catch (Exception e) {
Global.Error(e.Message);
return null;
}
}
public void Load(Dictionary<uint, Dictionary<(uint, uint), int>> data) {
//var partyObj = MBObjectManager.Instance.GetObject()
_armories.Clear();
var party = Campaign.Current.MobileParties.First(party => party.Id.InternalValue == 1);
throw new NotImplementedException();
}
}