Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
artifixer committed Jun 1, 2022
1 parent d7b71c7 commit 7a21a71
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 24 deletions.
8 changes: 4 additions & 4 deletions src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ public abstract class RebelFaction
{
[SaveableProperty(1)] public Clan SponsorClan { get; private set; }

[SaveableField(2)] [UsedImplicitly] private List<Clan> _participatingClans;
[SaveableField(2)][UsedImplicitly] private List<Clan> _participatingClans;

[SaveableProperty(3)] [UsedImplicitly] public Kingdom ParentKingdom { get; private set; }
[SaveableProperty(3)][UsedImplicitly] public Kingdom ParentKingdom { get; private set; }

[SaveableProperty(4)] public Kingdom? RebelKingdom { get; private set; }

[SaveableProperty(5)] public bool AtWar { get; set; }

[SaveableProperty(6)] [UsedImplicitly] public CampaignTime DateStarted { get; private set; }
[SaveableProperty(6)][UsedImplicitly] public CampaignTime DateStarted { get; private set; }

[SaveableProperty(7)] public TextObject Name { get; private set; }

[SaveableProperty(8)] [UsedImplicitly] public Dictionary<Town, Clan> OriginalFiefOwners { get; private set; }
[SaveableProperty(8)][UsedImplicitly] public Dictionary<Town, Clan> OriginalFiefOwners { get; private set; }

public abstract RebelDemandType RebelDemandType { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.Diplomacy/ExpansionismManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Diplomacy
{
internal sealed class ExpansionismManager
{
[SaveableField(1)] [UsedImplicitly] private Dictionary<IFaction, float> _expansionism;
[SaveableField(1)][UsedImplicitly] private Dictionary<IFaction, float> _expansionism;

public static ExpansionismManager? Instance { get; private set; }
public float SiegeExpansionism => Settings.Instance!.ExpanisonismPerSiege;
Expand Down
4 changes: 2 additions & 2 deletions src/Bannerlord.Diplomacy/Messengers/Messenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace Diplomacy.Messengers
{
internal class Messenger
{
[SaveableProperty(1)] [UsedImplicitly] public CampaignTime DispatchTime { get; private set; }
[SaveableProperty(1)][UsedImplicitly] public CampaignTime DispatchTime { get; private set; }

[SaveableProperty(2)] [UsedImplicitly] public Hero TargetHero { get; private set; }
[SaveableProperty(2)][UsedImplicitly] public Hero TargetHero { get; private set; }

[SaveableProperty(3)] public Vec2 CurrentPosition { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal sealed class MessengerManager : IMissionListener
private Messenger? _activeMessenger;
private Mission? _currentMission;

[SaveableField(1)] [UsedImplicitly] private List<Messenger> _messengers;
[SaveableField(1)][UsedImplicitly] private List<Messenger> _messengers;

public MBReadOnlyList<Messenger> Messengers { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private static IEnumerable<EncyclopediaListItem> PassThroughPostfix(IEnumerable<
{
foreach (var item in values.ToList())
{
var kingdom = (Kingdom)item.Object;
var kingdom = (Kingdom) item.Object;
if (kingdom.IsRebelKingdom() && kingdom.IsEliminated)
{
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
using System.Collections.Generic;

using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.Election;
using TaleWorlds.CampaignSystem.CampaignBehaviors;
using TaleWorlds.CampaignSystem.Election;

namespace Diplomacy.Patches
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using HarmonyLib;
/*
using HarmonyLib;
using JetBrains.Annotations;
Expand All @@ -9,10 +10,11 @@
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.CampaignBehaviors;
*/

// Outdated since e1.7.2?
namespace Diplomacy.Patches
{
// Outdated since e1.7.2?
/*
[HarmonyPatch(typeof(UrbanCharactersCampaignBehavior))]
[UsedImplicitly]
Expand Down
3 changes: 0 additions & 3 deletions src/Bannerlord.Diplomacy/SubModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using Diplomacy.Event;
using Diplomacy.PatchTools;

using HarmonyLib;

using Microsoft.Extensions.Logging;

using Serilog.Events;
Expand Down Expand Up @@ -51,7 +49,6 @@ protected override void OnSubModuleLoad()
Log = LogFactory.Get<SubModule>();

PatchManager.PatchAll(HarmonyDomain);
//new Harmony(HarmonyDomain).PatchAll(); // Will only keep this around while I convert all the remaining annotated patches.
}

protected override void OnSubModuleUnloaded()
Expand Down
8 changes: 4 additions & 4 deletions src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public string RelationGain
}
}

[DataSourceProperty] [UsedImplicitly] public float MinValue { get; }
[DataSourceProperty][UsedImplicitly] public float MinValue { get; }

[DataSourceProperty]
public int IntValue
Expand All @@ -80,11 +80,11 @@ public int IntValue
}
}

[DataSourceProperty] [UsedImplicitly] public string AcceptText { get; } = new TextObject(StringConstants.Accept).ToString();
[DataSourceProperty][UsedImplicitly] public string AcceptText { get; } = new TextObject(StringConstants.Accept).ToString();

[DataSourceProperty] [UsedImplicitly] public string CancelText { get; } = GameTexts.FindText("str_cancel").ToString();
[DataSourceProperty][UsedImplicitly] public string CancelText { get; } = GameTexts.FindText("str_cancel").ToString();

[DataSourceProperty] [UsedImplicitly] public string TitleText { get; } = new TextObject("{=Gzq6VHPt}Donate Gold").ToString();
[DataSourceProperty][UsedImplicitly] public string TitleText { get; } = new TextObject("{=Gzq6VHPt}Donate Gold").ToString();

public DonateGoldVM(Clan clan, Action onFinalize)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia;
using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia.EncyclopediaItems;
using TaleWorlds.Engine.Screens;
using TaleWorlds.Library;
using TaleWorlds.Localization;
using TaleWorlds.ScreenSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia;
using TaleWorlds.Engine.Screens;
using TaleWorlds.Library;
using TaleWorlds.Localization;
using TaleWorlds.ScreenSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using TaleWorlds.CampaignSystem;
using TaleWorlds.Core;
using TaleWorlds.Engine.Screens;
using TaleWorlds.Library;
using TaleWorlds.ScreenSystem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public BasicTooltipViewModel? NonAggressionPactScoreHint

[DataSourceProperty] public string AllianceActionName { get; }

[DataSourceProperty] [UsedImplicitly] public bool IsGoldCostVisible { get; }
[DataSourceProperty][UsedImplicitly] public bool IsGoldCostVisible { get; }

[DataSourceProperty] public string NonAggressionPactHelpText { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public int GoldCost
}
}

[DataSourceProperty] [UsedImplicitly] public bool IsGoldCostVisible { get; } = true;
[DataSourceProperty][UsedImplicitly] public bool IsGoldCostVisible { get; } = true;

[DataSourceProperty]
public bool IsOptionAvailable
Expand Down

0 comments on commit 7a21a71

Please sign in to comment.