Skip to content

Instantly share code, notes, and snippets.

@Kryzarel
Created December 3, 2017 21:28
Show Gist options
  • Save Kryzarel/d2595779b441726555fc4a409efd5f28 to your computer and use it in GitHub Desktop.
Save Kryzarel/d2595779b441726555fc4a409efd5f28 to your computer and use it in GitHub Desktop.
public readonly ReadOnlyCollection<StatModifier> StatModifiers; // Add this variable
public CharacterStat(float baseValue)
{
BaseValue = baseValue;
statModifiers = new List<StatModifier>();
StatModifiers = statModifiers.AsReadOnly(); // Add this line to the constructor
}
using System.Collections.ObjectModel; // Add this using statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment