Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 committed May 17, 2020
1 parent e39f05f commit 686af06
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions UtilityLibrary/ItemEntryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public static bool TryGetBaseEnchantment([NotNull] this ExtraContainerChanges.It
}

/// <summary>
/// Enum for Soul Gem types. Do note that
/// <see cref="None"/> can mean multiple things
/// as you can get <c>0</c> if something failed.
/// Enum for the type of soul in a soul gem.
/// Do note that <see cref="None"/> means there is
/// no soul in a soul gem or something went wrong.
/// <see cref="Grand"/> is also used by black soul gems.
/// </summary>
public enum SoulGemType : byte
public enum SoulType : byte
{
None = 0,
Petty = 1,
Expand All @@ -119,9 +119,15 @@ public enum SoulGemType : byte
Grand = 5
}

public static byte GetSoulGemType([NotNull] this ExtraContainerChanges.ItemEntry itemEntry)
/// <summary>
/// Get the type of soul in a soul gem. Will return <see cref="SoulType.None"/>
/// if there is no soul in the soul gem.
/// </summary>
/// <param name="itemEntry">The soul gem</param>
/// <returns>The soul in the given soul gem</returns>
public static SoulType GetSoulType([NotNull] this ExtraContainerChanges.ItemEntry itemEntry)
{
byte result = 0;
SoulType result = 0;

var item = itemEntry.Template;
if (item == null)
Expand All @@ -139,7 +145,7 @@ public static byte GetSoulGemType([NotNull] this ExtraContainerChanges.ItemEntry

BSSimpleList<BSExtraDataList> extraData = itemEntry.ExtraData;
if (extraData == null)
return baseSoul;
return (SoulType)baseSoul;

extraData.Where(x => x != null).Do(x =>
{
Expand All @@ -151,7 +157,7 @@ public static byte GetSoulGemType([NotNull] this ExtraContainerChanges.ItemEntry
if (soul == 0)
soul = baseSoul;
result = soul;
result = (SoulType)soul;
});

return result;
Expand Down

0 comments on commit 686af06

Please sign in to comment.