Files
Performance-Fish/Source/PerformanceFish/Utility/StringExtensions.cs
T
bbradson be3dae46bb Added stat caching, fixed all the bugs
Added RitualObligationTriggers analyzer category,
Fixed defs from other mods with broken market value breaking fish's storage patches,
Fixed storage caches not updating for quality, rotting and similar changes to stored things,
Fixed storage caches not updating capacity when reinstalling storage,
Fixed prison labor compatibility,
Improved multiplayer compatibility,
Fixed ideology style dominance and altar sharing patches throwing errors instead of defaulting to disabled when not having ideology,
Fixed compatibility with RIMMSqol's world pawn GC patch by disabling that patch,
Fixed rare threading issues throwing errors on startup
2024-03-10 20:05:24 +01:00

27 lines
1.1 KiB
C#

// Copyright (c) 2023 bradson
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
namespace PerformanceFish.Utility;
public static class StringExtensions
{
public static bool NameEqualsCaseInsensitive(this MethodInfo methodInfo, string name)
=> methodInfo.Name.Equals(name, StringComparison.OrdinalIgnoreCase);
public static string AppendNewLineWhen(this string instance, bool predicate, string text)
=> predicate ? instance.AppendNewLine(text) : instance;
public static string AppendNewLineWhenNotNull(this string instance, object? value)
=> value != null ? instance.AppendNewLine(value.ToString()) : instance;
public static string AppendNewLine(this string instance, string text)
=> string.Concat(instance, "\n", text);
public static string AppendWhen(this string instance, bool predicate, string text)
=> predicate ? instance + text : instance;
public static string AppendWhenNotNull(this string instance, object? value)
=> value != null ? instance + value : instance;
}