private string name; private int ID; private static int nextID = 1; private int score; public void Test() { Player player1 = new Player(); player1.Register(); player1.SetRandomInfo(); Console.WriteLine(InfoToString(player1)); Player player2 = new Player(); player2.Register(); player2.SetRandomInfo(); Console.WriteLine(InfoToString(player2)); } public void SetRandomInfo() { Random randomGen = new Random(); int random = randomGen.Next(100); name = "player" + random; random = randomGen.Next(20); score = random; }
Name
ID
score
DrandomGen = new Random((int) DateTime.Now.Ticks & 0x0000FFFF);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)