public ExePlayerInstance(ExePlayer player, Match match) { this.player = player; this.match = match; if (player.path.EndsWith(".jar")) { cmd = Settings.JavaCmd; args = "-jar " + player.path; } else if (player.path.EndsWith(".py")) { cmd = Settings.PythonCmd; args = player.path; } else if (player.path.EndsWith(".js")) { cmd = Settings.JavaScriptCmd; args = "-nologo " + player.path; } else { cmd = player.path; args = null; } }
public static void AddPlayer(String[] args) { if (args.Length != 2) { throw new Exception("Wrong number of arguments. A name and path must be specified."); } Player newPlayer = new ExePlayer(args[1], args[0]); players.Add(newPlayer); Console.WriteLine("Added player " + args[0] + ", located at: " + args[1]); }