What is the convention for passing in a list to a constructor and then
storing it?
Let's say I have code like this:
private IList<Vector3> vertices;
private IList<uint> indices;
public Mesh(IList<Vector3> vertices, IList<uint> indices)
{
// ???
}
To make it clear, I want to store the vertices and indices inside it in
the constructor. I've not worked very much with C# so I'm not sure how the
convention looks. Am I supposed to make a copy of the entire list or can I
just copy the reference? What's the convention?
No comments:
Post a Comment