Skip to content

Commit 2b62c39

Browse files
committed
Implement XML Docs for ResourceManagers Module of Community Patch
1 parent 212ff8a commit 2b62c39

2 files changed

Lines changed: 73 additions & 7 deletions

File tree

‎InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs‎

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace InscryptionCommunityPatch.ResourceManagers;
1010

11+
/// <summary>
12+
/// This patch handles information related to the Drone Configuration for Act 1.
13+
/// </summary>
1114
[HarmonyPatch]
1215
public static class EnergyDrone
1316
{
@@ -16,10 +19,25 @@ public static class EnergyDrone
1619
/// </summary>
1720
public class EnergyConfigInfo
1821
{
19-
public bool ConfigEnergy { get; set; } = PoolHasEnergy || PatchPlugin.configEnergyPerMatchCleanUp.Value;
22+
/// <summary>
23+
/// Whether or not the Energy Drone should be shown.
24+
/// </summary>
2025
public bool ConfigShowDrone { get; set; } = PoolHasEnergy || PatchPlugin.configEnergyDrone.Value;
26+
/// <summary>
27+
/// Whether or not the Energy Drone should be refreshed per match.
28+
/// </summary>
29+
public bool ConfigEnergy { get; set; } = PoolHasEnergy || PatchPlugin.configEnergyPerMatchCleanUp.Value;
30+
/// <summary>
31+
/// Whether or not the Mox Drone should be shown.
32+
/// </summary>
2133
public bool ConfigDroneMox { get; set; } = PoolHasGems || PatchPlugin.configMoxDrone.Value;
34+
/// <summary>
35+
/// Whether or not the Mox Drone should be refreshed per match.
36+
/// </summary>
2237
public bool ConfigMox { get; set; } = PoolHasGems || PatchPlugin.configMoxPerMatchCleanup.Value;
38+
/// <summary>
39+
/// Whether or not the Default Drone should be used.
40+
/// </summary>
2341
public bool ConfigDefaultDrone { get; set; } = PatchPlugin.configUtilizeDefaultDrone.Value;
2442

2543
/// <summary>
@@ -38,7 +56,12 @@ public class EnergyConfigInfo
3856
{ CardTemple.Tech, new() },
3957
{ CardTemple.Wizard, new() }
4058
};
41-
59+
60+
/// <summary>
61+
/// Validator used to ensure a Scene can have the Drone or not.
62+
/// </summary>
63+
/// <param name="sceneName">The scene we are checking.</param>
64+
/// <returns>True if the scene can have the drone, false otherwise.</returns>
4265
public static bool SceneCanHaveEnergyDrone(string sceneName)
4366
{
4467
string activeSceneName = sceneName.ToLowerInvariant();
@@ -48,6 +71,9 @@ public static bool SceneCanHaveEnergyDrone(string sceneName)
4871
return activeSceneName.Contains("magnificus") || activeSceneName.Contains("grimora");
4972
}
5073

74+
/// <summary>
75+
/// Determines whether the current Scene can have the Drone or not. Verified via <see cref="SceneCanHaveEnergyDrone"/>.
76+
/// </summary>
5177
public static bool CurrentSceneCanHaveEnergyDrone
5278
{
5379
get
@@ -61,7 +87,7 @@ public static bool CurrentSceneCanHaveEnergyDrone
6187
}
6288

6389
/// <summary>
64-
/// Returns the EnergyConfigInfo object corresponding to the current Act.
90+
/// Returns the <see cref="EnergyConfigInfo"/> object corresponding to the current Act.
6591
/// </summary>
6692
public static EnergyConfigInfo GetEnergyConfig()
6793
{
@@ -78,14 +104,26 @@ public static EnergyConfigInfo GetEnergyConfig()
78104
}
79105

80106
/// <summary>
81-
/// The EnergyConfigInfo for the current Act.
107+
/// The <see cref="EnergyConfigInfo"/> for the current Act.
82108
/// </summary>
83109
private static EnergyConfigInfo EnergyConfig => GetEnergyConfig();
84110

111+
/// <summary>
112+
/// Used to determine whether the current Card Pool has Energy or not.
113+
/// </summary>
85114
public static bool PoolHasEnergy { get; private set; }
115+
/// <summary>
116+
/// Used to determine whether the current Card Pool has Mox or not.
117+
/// </summary>
86118
public static bool PoolHasGems { get; private set; }
87119

88-
private static bool CardIsVisible(this CardInfo info, CardTemple targetTemple)
120+
/// <summary>
121+
/// Determines whether or not a card is a part of the <see cref="targetTemple"/> and if they have the meta categories needed in order for them to show up.
122+
/// </summary>
123+
/// <param name="info">The <see cref="CardInfo"/> of the card we are checking.</param>
124+
/// <param name="targetTemple">The temple in which we are targetting. Options are Nature -> <c>Act 1</c>, Undead -> <c>Grimora</c>, Wizard -> <c>Magnificus</c>.</param>
125+
/// <returns>True if the Card is part of one of the temples we are after, and if the card has any of the meta categories needed to show up in the given act, otherwise false.</returns>
126+
public static bool CardIsVisible(this CardInfo info, CardTemple targetTemple)
89127
{
90128
// if the CardInfo can't appear in this part of the game - Act 1 = Nature, Grimora = Undead, Magnificus = Wizard
91129
if (info.temple != targetTemple)
@@ -132,6 +170,7 @@ private static IEnumerator AwakeDrone()
132170
else
133171
AttachDroneToScale();
134172
}
173+
135174
private static void AttachDroneToScale()
136175
{
137176
try
@@ -189,13 +228,15 @@ private static bool Act1ResourceDrone_SetOnBoard(ResourceDrone __instance, bool
189228

190229
return false;
191230
}
231+
192232
[HarmonyPrefix, HarmonyPatch(typeof(ResourceDrone), nameof(ResourceDrone.UpdateCellAndGemColors))]
193233
private static bool DisableUpdateWhenNull()
194234
{
195235
if (ResourcesManager.m_Instance == null)
196236
return false;
197237
return true;
198238
}
239+
199240
[HarmonyPatch(typeof(Part1ResourcesManager), nameof(Part1ResourcesManager.CleanUp))]
200241
[HarmonyPrefix]
201242
private static void Part1ResourcesManager_CleanUp(Part1ResourcesManager __instance)

‎InscryptionCommunityPatch/ResourceManagers/ActThreeBonesDisplayer.cs‎

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,51 @@
1010

1111
namespace InscryptionCommunityPatch.ResourceManagers;
1212

13+
/// <summary>
14+
/// This patch handles adding the Bones Displayer to the Drone.
15+
/// </summary>
1316
[HarmonyPatch]
1417
public static class Act3BonesDisplayer
1518
{
19+
/// <summary>
20+
/// A bool determining whether the Bones Displayer should be forced to active.
21+
/// </summary>
1622
public static bool ForceBonesDisplayActive { get; set; } = false;
1723

24+
/// <summary>
25+
/// A bool determining whether the Bones Displayer is active, namely when any one of the following are true;
26+
/// <br/>
27+
/// - <see cref="ForceBonesDisplayActive"/>
28+
/// <br/>
29+
/// - <see cref="PoolHasBones"/>
30+
/// <br/>
31+
/// - <see cref="PatchPlugin.configAct3Bones"/>
32+
/// </summary>
1833
public static bool DisplayAct3Bones => ForceBonesDisplayActive || PoolHasBones || PatchPlugin.configAct3Bones.Value;
1934

35+
/// <summary>
36+
/// Determines whether or not a card is a part of the Tech Temple, and whether it has a Meta Category that can show in Act 3.
37+
/// </summary>
38+
/// <param name="info">The <see cref="CardInfo"/> of the card we are checking.</param>
39+
/// <returns>True if the card is a part of the Technology temple, and if the card has any of the meta categories needed to show up in the given act, otherwise false.</returns>
2040
private static bool CardIsVisible(this CardInfo info)
2141
{
2242
if (info.temple != CardTemple.Tech)
2343
return false;
2444

2545
// Now we check metacategories
2646
// If the card's metacategories are set such that it can't actually appear, don't count it
27-
return info.metaCategories.Exists((CardMetaCategory x) =>
28-
x == CardMetaCategory.ChoiceNode || x == CardMetaCategory.Part3Random || x == CardMetaCategory.Rare);
47+
return info.metaCategories.Exists((CardMetaCategory x) => x == CardMetaCategory.ChoiceNode || x == CardMetaCategory.Part3Random || x == CardMetaCategory.Rare);
2948
}
3049

50+
/// <summary>
51+
/// Determines whether the Card Pool has any cards that cost Bones, verified with <see cref="CardIsVisible"/>.
52+
/// </summary>
3153
public static bool PoolHasBones => CardManager.AllCardsCopy.Any(ci => ci.BonesCost > 0 && ci.CardIsVisible());
3254

55+
/// <summary>
56+
/// Determines whether the current Scene can have the Bones Displayer or not.
57+
/// </summary>
3358
public static bool SceneCanHaveBonesDisplayer
3459
{
3560
get

0 commit comments

Comments
 (0)