I am writing a game, will have a class just for my collision in the world. I want to pass it two lists in its constructor, one that will contain all the Enemies, and another that will contain all the bullets the player fires.
This is a 2d ship game done in XNA, I should say that, but I felt like posting here because it has more to do with C# ref keyword. If I use the ref keyword in the constructor when passing the Lists into it.
Now if I were to start messing around with the elements in the List, removal and adding of elements, modification etc, would since they were passed by reference make it so that I would never have to re-pass the lists into the class, if the lists themselves are contained in some other class?
public Collsion_manager(ref List<Bullet> bullets_world, ref List<Enemy_class> enemies_world) { }