Skip to content

Commit

Permalink
add readonly modifiers where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
al2me6 committed Jul 26, 2024
1 parent dc1b57a commit df60954
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Source/MaterialDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public class MaterialDef

[Persistent] public bool preserveRenderQueue = false;

public Dictionary<string, bool> keywords;
public Dictionary<string, float> floats;
public Dictionary<string, Color> colors;
public Dictionary<string, Vector4> vectors;
public Dictionary<string, string> textureNames;
public readonly Dictionary<string, bool> keywords;
public readonly Dictionary<string, float> floats;
public readonly Dictionary<string, Color> colors;
public readonly Dictionary<string, Vector4> vectors;
public readonly Dictionary<string, string> textureNames;

readonly Dictionary<string, Texture> textures = new Dictionary<string, Texture>();

Expand Down
2 changes: 1 addition & 1 deletion Source/MaterialReplacement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Shabby

public class MaterialReplacement : ModelFilter
{
public MaterialDef materialDef = null;
public readonly MaterialDef materialDef = null;
readonly Dictionary<Material, Material> replacedMaterials = new Dictionary<Material, Material>();

public MaterialReplacement(ConfigNode node) : base(node)
Expand Down
8 changes: 4 additions & 4 deletions Source/ModelFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ namespace Shabby
{
public class ModelFilter
{
public HashSet<string> targetMaterials;
public HashSet<string> targetTransforms;
public bool blanketApply;
public readonly HashSet<string> targetMaterials;
public readonly HashSet<string> targetTransforms;
public readonly bool blanketApply;

public HashSet<string> ignoredMeshes;
public readonly HashSet<string> ignoredMeshes;

public ModelFilter(ConfigNode node)
{
Expand Down

0 comments on commit df60954

Please sign in to comment.