本文整理汇总了C#中Client.EvolvePokemon方法的典型用法代码示例。如果您正苦于以下问题:C# Client.EvolvePokemon方法的具体用法?C# Client.EvolvePokemon怎么用?C# Client.EvolvePokemon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.EvolvePokemon方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EvolveAllGivenPokemons
private static async Task EvolveAllGivenPokemons(Client client, IEnumerable<PokemonData> pokemonToEvolve)
{
foreach (var pokemon in pokemonToEvolve)
{
var countOfEvolvedUnits = 0;
var xpCount = 0;
EvolvePokemonOut evolvePokemonOutProto;
do
{
evolvePokemonOutProto = await client.EvolvePokemon(pokemon.Id);
//todo: someone check whether this still works
if (evolvePokemonOutProto.Result == 1)
{
ColoredConsoleWrite(ConsoleColor.Cyan,
$"[{DateTime.Now.ToString("HH:mm:ss")}] Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExpAwarded}xp");
countOfEvolvedUnits++;
xpCount += evolvePokemonOutProto.ExpAwarded;
}
else
{
var result = evolvePokemonOutProto.Result;
}
} while (evolvePokemonOutProto.Result == 1);
if (countOfEvolvedUnits > 0)
ColoredConsoleWrite(ConsoleColor.Cyan,
$"[{DateTime.Now.ToString("HH:mm:ss")}] Evolved {countOfEvolvedUnits} pieces of {pokemon.PokemonId} for {xpCount}xp");
await Task.Delay(3000);
}
}
示例2: EvolveAllGivenPokemons
private static async Task EvolveAllGivenPokemons(Client client, IEnumerable<PokemonData> pokemonToEvolve)
{
foreach (var pokemon in pokemonToEvolve)
{
/*
enum Holoholo.Rpc.Types.EvolvePokemonOutProto.Result {
UNSET = 0;
SUCCESS = 1;
FAILED_POKEMON_MISSING = 2;
FAILED_INSUFFICIENT_RESOURCES = 3;
FAILED_POKEMON_CANNOT_EVOLVE = 4;
FAILED_POKEMON_IS_DEPLOYED = 5;
}
}*/
var countOfEvolvedUnits = 0;
var xpCount = 0;
EvolvePokemonOut evolvePokemonOutProto;
do
{
evolvePokemonOutProto = await client.EvolvePokemon(pokemon.Id);
//todo: someone check whether this still works
if (evolvePokemonOutProto.Result == 1)
{
ColoredConsoleWrite(ConsoleColor.Cyan,
$"[{DateTime.Now.ToString("HH:mm:ss")}] Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExpAwarded}xp");
countOfEvolvedUnits++;
xpCount += evolvePokemonOutProto.ExpAwarded;
}
else
{
var result = evolvePokemonOutProto.Result;
/*
ColoredConsoleWrite(ConsoleColor.White, $"Failed to evolve {pokemon.PokemonId}. " +
$"EvolvePokemonOutProto.Result was {result}");
ColoredConsoleWrite(ConsoleColor.White, $"Due to above error, stopping evolving {pokemon.PokemonId}");
*/
}
} while (evolvePokemonOutProto.Result == 1);
if (countOfEvolvedUnits > 0)
ColoredConsoleWrite(ConsoleColor.Cyan,
$"[{DateTime.Now.ToString("HH:mm:ss")}] Evolved {countOfEvolvedUnits} pieces of {pokemon.PokemonId} for {xpCount}xp");
await Task.Delay(3000);
}
}
示例3: EvolveAllGivenPokemons
private async Task EvolveAllGivenPokemons(Client client, IEnumerable<PokemonData> pokemonToEvolve)
{
foreach (var pokemon in pokemonToEvolve)
{
var countOfEvolvedUnits = 0;
var xpCount = 0;
EvolvePokemonOut evolvePokemonOutProto;
do
{
evolvePokemonOutProto = await client.EvolvePokemon(pokemon.Id);
//todo: someone check whether this still works
if (evolvePokemonOutProto.Result == 1)
{
countOfEvolvedUnits++;
xpCount += evolvePokemonOutProto.ExpAwarded;
TotalExperience += evolvePokemonOutProto.ExpAwarded;
}
} while (evolvePokemonOutProto.Result == 1);
if (countOfEvolvedUnits > 0)
ColoredConsoleWrite(Color.Cyan,
$"Evolved {countOfEvolvedUnits} pieces of {pokemon.PokemonId} for {xpCount}xp");
await Task.Delay(3000);
}
}
示例4: EvolveAllGivenPokemons
private async Task EvolveAllGivenPokemons(Client client, IEnumerable<PokemonData> pokemonToEvolve)
{
foreach (var pokemon in pokemonToEvolve)
{
/*
enum Holoholo.Rpc.Types.EvolvePokemonOutProto.Result {
UNSET = 0;
SUCCESS = 1;
FAILED_POKEMON_MISSING = 2;
FAILED_INSUFFICIENT_RESOURCES = 3;
FAILED_POKEMON_CANNOT_EVOLVE = 4;
FAILED_POKEMON_IS_DEPLOYED = 5;
}
}*/
var countOfEvolvedUnits = 0;
var xpCount = 0;
EvolvePokemonOut evolvePokemonOutProto;
do
{
evolvePokemonOutProto = await client.EvolvePokemon(pokemon.Id);
//todo: someone check whether this still works
if (evolvePokemonOutProto.Result == 1)
{
ColoredConsoleWrite(Color.Cyan,
$"Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExpAwarded} xp {pokemon.Cp} cp and IV {Perfect(pokemon)}%");
TotalExperience += (evolvePokemonOutProto.ExpAwarded);
countOfEvolvedUnits++;
xpCount += evolvePokemonOutProto.ExpAwarded;
await Task.Delay(0); //3000
}
else
{
var result = evolvePokemonOutProto.Result;
/*
ColoredConsoleWrite(ConsoleColor.White, $"Failed to evolve {pokemon.PokemonId}. " +
$"EvolvePokemonOutProto.Result was {result}");
ColoredConsoleWrite(ConsoleColor.White, $"Due to above error, stopping evolving {pokemon.PokemonId}");
*/
}
} while (evolvePokemonOutProto.Result == 1 && TransfertAndEvolveSetting.toEvolve.Contains(evolvePokemonOutProto.EvolvedPokemon.PokemonType));
if (countOfEvolvedUnits > 0)
ColoredConsoleWrite(Color.Cyan,
$"Evolved {countOfEvolvedUnits} pieces of {pokemon.PokemonId} for {xpCount}xp");
}
}
示例5: EvolveAllGivenPokemons
private static async Task EvolveAllGivenPokemons(Client client, IEnumerable<PokemonData> pokemonToEvolve)
{
foreach (var pokemon in pokemonToEvolve)
{
var countOfEvolvedUnits = 0;
var xpCount = 0;
EvolvePokemonOut evolvePokemonOutProto;
var blacklistEvolvePokemonTypes = new[]
{
PokemonId.Goldeen
};
foreach (var unwantedPokemonType in blacklistEvolvePokemonTypes)
{
var pokemonOfDesiredType = pokemonToEvolve.Where(p => p.PokemonId == unwantedPokemonType)
.ToList();
if (pokemonOfDesiredType.Any())
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"Blacklisted: {pokemon.PokemonId}");
Console.ForegroundColor = ConsoleColor.White;
return;
}
}
do
{
evolvePokemonOutProto = await client.EvolvePokemon(pokemon.Id);
//todo: someone check whether this still works
if (evolvePokemonOutProto.Result == (EvolvePokemonOut.Types.EvolvePokemonStatus)1)
{
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExpAwarded}xp");
Console.ForegroundColor = ConsoleColor.White;
countOfEvolvedUnits++;
xpCount += evolvePokemonOutProto.ExpAwarded;
}
else
{
var result = evolvePokemonOutProto.Result;
Console.WriteLine($"Failed to evolve {pokemon.PokemonId}. " +
$"EvolvePokemonOutProto.Result was {result}");
Console.WriteLine($"Due to above error, stopping evolving {pokemon.PokemonId}");
}
}
while (evolvePokemonOutProto.Result == (EvolvePokemonOut.Types.EvolvePokemonStatus)1 && (evolvePokemonOutProto.Result == EvolvePokemonOut.Types.EvolvePokemonStatus.FailedInsufficientResources || evolvePokemonOutProto.Result == EvolvePokemonOut.Types.EvolvePokemonStatus.FailedPokemonCannotEvolve));
if (countOfEvolvedUnits > 0)
Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}] Evolved {countOfEvolvedUnits} piece of {pokemon.PokemonId} for {xpCount}xp");
await Task.Delay(3000);
}
}