Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Aug 31, 2024
1 parent 09785cd commit 28f17bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Winch/Util/WinchExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ public static bool IsNullOrWhiteSpace(this JToken token)
(token.Type == JTokenType.Undefined);
}

/// <summary>
/// Copy of <see cref="AchievementData.Print"/> except it actually returns the string instead of logging it.
/// </summary>
public static string ToPrintedString(this AchievementData achievement)
{
string printStr = $"{achievement.id}: ";
Expand All @@ -649,13 +652,19 @@ public static string ToPrintedString(this AchievementData achievement)
return printStr;
}

/// <summary>
/// Checks if both crab pot POI datas have identical serializable data excluding <see cref="SerializedCrabPotPOIData.grid"/>
/// </summary>
public static bool Identical(this SerializedCrabPotPOIData a, SerializedCrabPotPOIData b)
{
return a.deployableItemId == b.deployableItemId && a.x == b.x && a.z == b.z
&& a.lastUpdate == b.lastUpdate && a.timeUntilNextCatchRoll == b.timeUntilNextCatchRoll
&& a.durability == b.durability && a.hadDurabilityRemaining == b.hadDurabilityRemaining;
}

/// <summary>
/// Makes an uninitialized crab pot POI data with identical serializable data excluding <see cref="SerializedCrabPotPOIData.grid"/>
/// </summary>
public static SerializedCrabPotPOIData MakeIdentical(this SerializedCrabPotPOIData crabPotPOI)
{
var partialCrabPot = (SerializedCrabPotPOIData)FormatterServices.GetUninitializedObject(typeof(SerializedCrabPotPOIData));
Expand Down

0 comments on commit 28f17bb

Please sign in to comment.