Exemplo n.º 1
0
        public static async Task <IReadOnlyList <Adversary> > GetAdversariesAsync(GameServiceClient client, IReadOnlyList <int> adversaryIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
        {
            var request = new GetAdversariesRequest();

            if (adversaryIds != null && adversaryIds.Count() != 0)
            {
                request.AdversaryIds.AddRange(adversaryIds);
            }
            else if (!string.IsNullOrWhiteSpace(name))
            {
                request.Name = name;
            }

            request.NameMatchStyle = nameMatchStyle;

            return((await client.GetAdversariesAsync(request)).Adversaries);
        }