RoR2-ChensHelpers

Contains simple and useful helpers for RoR2 mod creators to use. Mainly caters to Chen's mods.

View on GitHub

ChensHelpers

Chen.Helpers.CollectionHelpers

Extensions Class

Useful extensions that relate to collection data structures.

public static class Extensions

Inheritance System.Object 🡒 Extensions

Methods  
ConditionalAdd<T>(List<T>, T, Func<T,bool>) Adds an item into the list if the condition is not met.
This is just a combination for Add and Exists.
ConditionalAddRange<T>(List<T>, T[], Func<T,T,bool>) Adds a range of values into the list. Each item will be processed from the data and will checked by the given condition.
If the item matches the condition, it will not be added.
ConditionalRemove<T>(List<T>, T) Removes the item from the list if it exists.
This is just a combination for Contains and Remove.
Contains<T>(T[], T) Checks if a value exists within the array.
ToList<T>(T[]) Converts an array into their List counterpart.