I'm working on a project where I need to create many objects. I would like to call the objects player1, player2, player3, etc.
Class Player
{
public string Name { get; set; }
public List<string> NotPlayedAgainst { get; set; }
public List<string> NotPlayedWith { get; set; }
public int PositivePoints { get; set; }
public int NegativePoints { get; set; }
}
Now creating the objects by repeating following code:
int x = 1;
Player player(x) = new Player();
x++;
I need to be able to call the objects using a rule later in the code. So I would also like to know how to call these objects using a rule like this:
player(x).Name = /*some code*/