Skip to content

Commit

Permalink
cleaned up sourcedescription
Browse files Browse the repository at this point in the history
* changed public fields to properties
* create new instances in Empty property to ensure immutability
  • Loading branch information
WolfgangSt committed Jul 4, 2011
1 parent 63c11ef commit e55f278
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions IIS.SLSharp/Descriptions/SourceDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,31 @@ namespace IIS.SLSharp.Descriptions
// everywhere to improve performance
public class SourceDescription
{
public readonly List<FunctionDescription> Functions;
public List<FunctionDescription> Functions { get; private set; }

public readonly List<VariableDescription> Uniforms;
public List<VariableDescription> Uniforms { get; private set; }

public readonly List<VariableDescription> Attributes;
public List<VariableDescription> Attributes { get; private set; }

public readonly List<VariableDescription> Varyings;
public List<VariableDescription> Varyings { get; private set; }

public readonly List<VariableDescription> VertexIns;
public List<VariableDescription> VertexIns { get; private set; }

public readonly List<VariableDescription> FragmentOuts;
public List<VariableDescription> FragmentOuts { get; private set; }

public readonly List<string> ForwardDecl;
public List<string> ForwardDecl { get; private set; }

public static readonly SourceDescription Empty = new SourceDescription(
new List<FunctionDescription>(), new List<VariableDescription>(),
new List<VariableDescription>(), new List<VariableDescription>(),
new List<VariableDescription>(), new List<VariableDescription>(),
new List<string>());
public static SourceDescription Empty
{
get
{
return new SourceDescription(
new List<FunctionDescription>(), new List<VariableDescription>(),
new List<VariableDescription>(), new List<VariableDescription>(),
new List<VariableDescription>(), new List<VariableDescription>(),
new List<string>());
}
}

public SourceDescription(List<FunctionDescription> functions,
List<VariableDescription> uniforms, List<VariableDescription> attributes,
Expand Down

0 comments on commit e55f278

Please sign in to comment.