예제 #1
0
        /// <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);
        }
예제 #2
0
파일: Client.cs 프로젝트: Corniel/Vindinium
 public Client(ClientParameters parameters)
 {
     this.Parameters = parameters;
 }