/// <summary>Creates client parameters.</summary> public static ClientParameters Create(string key, string serverUrl, bool trainingsmode, int turns = 300, int runs = 1, string map = null) { if (String.IsNullOrEmpty(key)) { throw new ArgumentNullException("key"); } if (String.IsNullOrEmpty(key)) { throw new ArgumentNullException("serverUrl"); } if (turns < 1) { throw new ArgumentOutOfRangeException("turns", "Turns should be bigger than 0."); } var parameters = new ClientParameters() { Key = key, Url = Path.Combine(serverUrl, "api", trainingsmode ? "training" : "arena").Replace('\\', '/'), IsTraining = trainingsmode, Turns = turns, Runs = runs, Map = map, }; return(parameters); }
public Client(ClientParameters parameters) { this.Parameters = parameters; }