help
Root Question Message
using System.Collections.Specialized;
class Program
{
static void Main(string[] args)
{
string[] input = Console.ReadLine().Split(' ');
Player player = new Player(input[0], Int32.Parse(input[1]));
}
class Player
{
public string _playerName;
public int playerID;
public Player(string playerName,int playerIdentifier)
{
_playerName = playerName;
playerID = playerIdentifier;
Tuple<string, int> playerInfo = new Tuple<string, int>(_playerName,playerID);
}
}
}
(string, int)
over Tuple<string, int>
(string, int)
is a shorthand for ValueTuple<string, int>
, which is a better and more lightweight option to Tuple<string, int>
class Player
{
public string _playerName;
public int playerID;
public Player(string playerName,int playerIdentifier)
{
_playerName = playerName;
playerID = playerIdentifier;
List<Player> Players;
}
}
foreach (Player player in Players) { ... }