示例#1
0
 public static WhereStatementType GetWhereComparisonType(NameMatchStyle matchStyle)
 {
     return(matchStyle == NameMatchStyle.Similar ?
            WhereStatementType.Like :
            matchStyle == NameMatchStyle.MixedCase ?
            WhereStatementType.Equals :
            WhereStatementType.BinaryEquals);
 }
示例#2
0
        public static async Task <IReadOnlyList <Ally> > GetAlliesAsync(GameServiceClient client, IReadOnlyList <int> allyIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
        {
            var request = new GetAlliesRequest();

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

            request.NameMatchStyle = nameMatchStyle;

            return((await client.GetAlliesAsync(request)).Allies);
        }
示例#3
0
 public static async Task DisplayAlliesAsync(GameServiceClient client, IReadOnlyList <int> allyIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
 {
     foreach (var ally in await GetAlliesAsync(client, allyIds, name, nameMatchStyle))
     {
         ConsoleUtility.WriteLine($"{ally}");
     }
 }
示例#4
0
 public static async Task DisplayMastermindsAsync(GameServiceClient client, IReadOnlyList <int> mastermindIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
 {
     foreach (var mastermind in await GetMastermindsAsync(client, mastermindIds, name, nameMatchStyle))
     {
         ConsoleUtility.WriteLine($"{mastermind}");
     }
 }
示例#5
0
 public static async Task DisplaySchemesAsync(GameServiceClient client, IReadOnlyList <int> schemeIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
 {
     foreach (var scheme in await GetSchemesAsync(client, schemeIds, name, nameMatchStyle))
     {
         ConsoleUtility.WriteLine($"{scheme}");
     }
 }
示例#6
0
        public static async Task <IReadOnlyList <Henchman> > GetHenchmenAsync(GameServiceClient client, IReadOnlyList <int> henchmanIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
        {
            var request = new GetHenchmenRequest();

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

            request.NameMatchStyle = nameMatchStyle;

            return((await client.GetHenchmenAsync(request)).Henchmen);
        }
示例#7
0
 public static async Task DisplayHenchmenAsync(GameServiceClient client, IReadOnlyList <int> henchmanIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
 {
     foreach (var henchman in await GetHenchmenAsync(client, henchmanIds, name, nameMatchStyle))
     {
         ConsoleUtility.WriteLine($"{henchman}");
     }
 }
示例#8
0
        public static async Task DisplayTeamsAsync(GameServiceClient client, IReadOnlyList <int> teamIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
        {
            var request = new GetTeamsRequest();

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

            request.NameMatchStyle = nameMatchStyle;

            var teams = await client.GetTeamsAsync(request);

            foreach (var team in teams.Teams)
            {
                ConsoleUtility.WriteLine($"{team}");
            }
        }
示例#9
0
 public static async Task DisplayNeutralsAsync(GameServiceClient client, IReadOnlyList <int> neutralIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
 {
     foreach (var neutral in await GetNeutralsAsync(client, neutralIds, name, nameMatchStyle))
     {
         ConsoleUtility.WriteLine($"{neutral}");
     }
 }
示例#10
0
        public static async Task DisplayClassesAsync(GameServiceClient client, IReadOnlyList <int> classIds = null, string name = null, NameMatchStyle nameMatchStyle = NameMatchStyle.MixedCase)
        {
            var request = new GetClassesRequest();

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

            request.NameMatchStyle = nameMatchStyle;

            var classes = await client.GetClassesAsync(request);

            foreach (var @class in classes.Classes)
            {
                ConsoleUtility.WriteLine($"{@class}");
            }
        }