コード例 #1
0
        public static async Task CreateHenchmanAsync(GameServiceClient client)
        {
            var henchman = new Henchman();

            henchman.Name          = ConsoleUtility.GetUserInput("Henchman Name: ");
            henchman.GamePackageId = await GamePackageUtility.SelectGamePackageId(client);

            henchman.AbilityIds.AddRange(await AbilityUtility.SelectAbilityIds(client));

            if (!ConsoleUtility.ShouldContinue($"Creating Henchman: '{henchman.Name}', in gamePackage '{henchman.GamePackageId}' with abilities [{henchman.AbilityIds.Select(x => x.ToString()).Join(", ")}]"))
            {
                await CreateHenchmanAsync(client);

                return;
            }

            var createRequest = new CreateHenchmenRequest();

            createRequest.Henchmen.Add(henchman);
            var createReply = await client.CreateHenchmenAsync(createRequest);

            if (createReply.Status.Code != 200)
            {
                ConsoleUtility.WriteLine($"Failed to create henchman: {createReply.Status.Message}");
            }
            else
            {
                ConsoleUtility.WriteLine($"Henchman '{createReply.Henchmen.First().Name}' was created with Id '{createReply.Henchmen.First().Id}'");
            }
        }
コード例 #2
0
        public static async Task CreateAdversaryAsync(GameServiceClient client)
        {
            var adversary = new Adversary();

            adversary.Name          = ConsoleUtility.GetUserInput("Adversary Name: ");
            adversary.GamePackageId = await GamePackageUtility.SelectGamePackageId(client);

            adversary.AbilityIds.AddRange(await AbilityUtility.SelectAbilityIds(client));

            if (!ConsoleUtility.ShouldContinue($"Creating Adversary: '{adversary.Name}', in gamePackage '{adversary.GamePackageId}' with abilities [{adversary.AbilityIds.Select(x => x.ToString()).Join(", ")}]"))
            {
                await CreateAdversaryAsync(client);

                return;
            }

            var createRequest = new CreateAdversariesRequest();

            createRequest.Adversaries.Add(adversary);
            var createReply = await client.CreateAdversariesAsync(createRequest);

            if (createReply.Status.Code != 200)
            {
                ConsoleUtility.WriteLine($"Failed to create adversary: {createReply.Status.Message}");
            }
            else
            {
                ConsoleUtility.WriteLine($"Adversary '{createReply.Adversaries.First().Name}' was created with Id '{createReply.Adversaries.First().Id}'");
            }
        }
コード例 #3
0
        public static async Task CreateSchemeAsync(GameServiceClient client)
        {
            var scheme = new Scheme();

            scheme.Name          = ConsoleUtility.GetUserInput("Scheme Name: ");
            scheme.GamePackageId = await GamePackageUtility.SelectGamePackageId(client);

            scheme.AbilityIds.AddRange(await AbilityUtility.SelectAbilityIds(client));
            scheme.HasEpicSide = ConsoleUtility.GetUserInputBool("Has Epic side?");
            scheme.CardRequirements.AddRange(await CardRequirementUtility.GetCardRequirements(client, scheme.GamePackageId, true));
            scheme.TwistRequirements.AddRange(TwistRequirementUtility.GetTwistRequirements(client));

            if (!ConsoleUtility.ShouldContinue($"Creating Scheme: {scheme}"))
            {
                await CreateSchemeAsync(client);

                return;
            }

            var createRequest = new CreateSchemesRequest();

            createRequest.Schemes.Add(scheme);
            var createReply = await client.CreateSchemesAsync(createRequest);

            if (createReply.Status.Code != 200)
            {
                ConsoleUtility.WriteLine($"Failed to create scheme: {createReply.Status.Message}");
            }
            else
            {
                ConsoleUtility.WriteLine($"Scheme '{createReply.Schemes.First().Name}' was created with Id '{createReply.Schemes.First().Id}'");
            }
        }
コード例 #4
0
        public static async Task CreateNeutralAsync(GameServiceClient client)
        {
            var neutral = new Neutral();

            neutral.Name          = ConsoleUtility.GetUserInput("Neutral Name: ");
            neutral.GamePackageId = await GamePackageUtility.SelectGamePackageId(client);

            if (!ConsoleUtility.ShouldContinue($"Creating Neutral: '{neutral.Name}', in gamePackage '{neutral.GamePackageId}'"))
            {
                await CreateNeutralAsync(client);

                return;
            }

            var createRequest = new CreateNeutralsRequest();

            createRequest.Neutrals.Add(neutral);
            var createReply = await client.CreateNeutralsAsync(createRequest);

            if (createReply.Status.Code != 200)
            {
                ConsoleUtility.WriteLine($"Failed to create neutral: {createReply.Status.Message}");
            }
            else
            {
                ConsoleUtility.WriteLine($"Neutral '{createReply.Neutrals.First().Name}' was created with Id '{createReply.Neutrals.First().Id}'");
            }
        }
コード例 #5
0
        public static async Task CreateMastermindAsync(GameServiceClient client)
        {
            var mastermind = new Mastermind();

            mastermind.Name          = ConsoleUtility.GetUserInput("Mastermind Name: ");
            mastermind.GamePackageId = await GamePackageUtility.SelectGamePackageId(client);

            mastermind.AbilityIds.AddRange(await AbilityUtility.SelectAbilityIds(client));
            mastermind.HasEpicSide = ConsoleUtility.GetUserInputBool("Has Epic side?");
            mastermind.CardRequirements.AddRange(await CardRequirementUtility.GetCardRequirements(client, mastermind.GamePackageId, true));

            if (!ConsoleUtility.ShouldContinue($"Creating Mastermind: {mastermind}"))
            {
                await CreateMastermindAsync(client);

                return;
            }

            var createRequest = new CreateMastermindsRequest();

            createRequest.Masterminds.Add(mastermind);
            var createReply = await client.CreateMastermindsAsync(createRequest);

            if (createReply.Status.Code != 200)
            {
                ConsoleUtility.WriteLine($"Failed to create mastermind: {createReply.Status.Message}");
            }
            else
            {
                ConsoleUtility.WriteLine($"Mastermind '{createReply.Masterminds.First().Name}' was created with Id '{createReply.Masterminds.First().Id}'");
            }
        }