本文整理汇总了C#中Client.TransferPokemon方法的典型用法代码示例。如果您正苦于以下问题:C# Client.TransferPokemon方法的具体用法?C# Client.TransferPokemon怎么用?C# Client.TransferPokemon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.TransferPokemon方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransferAllGivenPokemons
private static async Task TransferAllGivenPokemons(Client client, IEnumerable<PokemonData> unwantedPokemons, float keepPerfectPokemonLimit = 80.0f)
{
foreach (var pokemon in unwantedPokemons)
{
if (Perfect(pokemon) >= keepPerfectPokemonLimit) continue;
ColoredConsoleWrite(ConsoleColor.White, $"Pokemon {pokemon.PokemonId} with {pokemon.Cp} CP has IV percent less than {keepPerfectPokemonLimit}%");
if (pokemon.Favorite == 0)
{
var transferPokemonResponse = await client.TransferPokemon(pokemon.Id);
/*
ReleasePokemonOutProto.Status {
UNSET = 0;
SUCCESS = 1;
POKEMON_DEPLOYED = 2;
FAILED = 3;
ERROR_POKEMON_IS_EGG = 4;
}*/
string pokemonName;
if (ClientSettings.Language == "german")
{
ColoredConsoleWrite(ConsoleColor.DarkCyan, "german");
string name_english = Convert.ToString(pokemon.PokemonId);
var request = (HttpWebRequest)WebRequest.Create("http://boosting-service.de/pokemon/index.php?pokeName=" + name_english);
var response = (HttpWebResponse)request.GetResponse();
pokemonName = new StreamReader(response.GetResponseStream()).ReadToEnd();
}
else
pokemonName = Convert.ToString(pokemon.PokemonId);
if (transferPokemonResponse.Status == 1)
{
ColoredConsoleWrite(ConsoleColor.Magenta, $"Transferred {pokemonName} with {pokemon.Cp} CP");
}
else
{
var status = transferPokemonResponse.Status;
ColoredConsoleWrite(ConsoleColor.Red, $"Somehow failed to transfer {pokemonName} with {pokemon.Cp} CP. " +
$"ReleasePokemonOutProto.Status was {status}");
}
await Task.Delay(3000);
}
}
}
示例2: TransferDuplicatePokemon
private static async Task TransferDuplicatePokemon(Client client)
{
//ColoredConsoleWrite(ConsoleColor.White, $"Check for duplicates");
var inventory = await client.GetInventory();
var allpokemons =
inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Pokemon)
.Where(p => p != null && p?.PokemonId > 0);
var dupes = allpokemons.OrderBy(x => x.Cp).Select((x, i) => new { index = i, value = x })
.GroupBy(x => x.value.PokemonId)
.Where(x => x.Skip(1).Any());
for (var i = 0; i < dupes.Count(); i++)
{
for (var j = 0; j < dupes.ElementAt(i).Count() - 1; j++)
{
var dubpokemon = dupes.ElementAt(i).ElementAt(j).value;
if (dubpokemon.Favorite == 0)
{
var transfer = await client.TransferPokemon(dubpokemon.Id);
string pokemonName;
if (ClientSettings.Language == "german")
{
string name_english = Convert.ToString(dubpokemon.PokemonId);
var request = (HttpWebRequest)WebRequest.Create("http://boosting-service.de/pokemon/index.php?pokeName=" + name_english);
var response = (HttpWebResponse)request.GetResponse();
pokemonName = new StreamReader(response.GetResponseStream()).ReadToEnd();
}
else
pokemonName = Convert.ToString(dubpokemon.PokemonId);
ColoredConsoleWrite(ConsoleColor.DarkGreen,
$"Transferred {pokemonName} with {dubpokemon.Cp} CP (Highest is {dupes.ElementAt(i).Last().value.Cp})");
}
}
}
}
示例3: TransferDuplicatePokemon
private async Task TransferDuplicatePokemon(Client client)
{
//ColoredConsoleWrite(ConsoleColor.White, $"Check for duplicates");
var inventory = await client.GetInventory();
var allpokemons =
inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Pokemon)
.Where(p => p != null && p?.PokemonId > 0);
var dupes = allpokemons.OrderBy(x => x.Cp).Select((x, i) => new { index = i, value = x })
.GroupBy(x => x.value.PokemonId)
.Where(x => x.Skip(1).Any());
for (var i = 0; i < dupes.Count(); i++)
{
for (var j = 0; j < dupes.ElementAt(i).Count() - 1; j++)
{
var dubpokemon = dupes.ElementAt(i).ElementAt(j).value;
if (dubpokemon.Favorite == 0)
{
var transfer = await client.TransferPokemon(dubpokemon.Id);
string pokemonName;
if (language == "german")
pokemonName = LanguageSetting.GermanName[(int)dubpokemon.PokemonId - 1];
else if (language == "french")
pokemonName = LanguageSetting.frenchPokemons[(int)dubpokemon.PokemonId - 1];
else
pokemonName = Convert.ToString(dubpokemon.PokemonId);
ColoredConsoleWrite(Color.DarkGreen,
$"Transferred {pokemonName} with {dubpokemon.Cp} CP (Highest is {dupes.ElementAt(i).Last().value.Cp})");
}
}
}
}
示例4: TransferDuplicatePokemon
private static async Task TransferDuplicatePokemon(Client client)
{
var inventory = await client.GetInventory();
var allpokemons =
inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Pokemon)
.Where(p => p != null && p?.PokemonId > 0);
var dupes = allpokemons.OrderBy(x => x.Cp).Select((x, i) => new { index = i, value = x })
.GroupBy(x => x.value.PokemonId)
.Where(x => x.Skip(1).Any());
for (var i = 0; i < dupes.Count(); i++)
{
for (var j = 0; j < dupes.ElementAt(i).Count() - 1; j++)
{
var dubpokemon = dupes.ElementAt(i).ElementAt(j).value;
if (dubpokemon.Favorite == 0)
{
await Task.Delay(defaultDelay); ColoredConsoleWrite(ConsoleColor.White, $"TransferPokemon");
var transfer = await client.TransferPokemon(dubpokemon.Id);
ColoredConsoleWrite(ConsoleColor.DarkGreen,
$"[{DateTime.Now.ToString("HH:mm:ss")}] {Language.GetPhrases()["transferred_low_pokemon"].Replace("[pokemon]", Language.GetPokemons()[Convert.ToString(dubpokemon.PokemonId)]).Replace("[cp]", Convert.ToString(dubpokemon.Cp)).Replace("[high_cp]", Convert.ToString(dupes.ElementAt(i).Last().value.Cp))}");
}
}
}
}
示例5: TransferAllGivenPokemons
private async Task TransferAllGivenPokemons(Client client, IEnumerable<PokemonData> unwantedPokemons, float keepPerfectPokemonLimit = 80.0f)
{
foreach (var pokemon in unwantedPokemons)
{
//if (Perfect(pokemon) >= keepPerfectPokemonLimit) continue;
if (pokemon.Favorite == 0)
{
var transferPokemonResponse = await client.TransferPokemon(pokemon.Id);
/*
ReleasePokemonOutProto.Status {
UNSET = 0;
SUCCESS = 1;
POKEMON_DEPLOYED = 2;
FAILED = 3;
ERROR_POKEMON_IS_EGG = 4;
}*/
string pokemonName;
if (language == "german")
pokemonName = LanguageSetting.GermanName[(int)pokemon.PokemonId - 1];
else if (language == "french")
pokemonName = LanguageSetting.frenchPokemons[(int)pokemon.PokemonId - 1];
else
pokemonName = Convert.ToString(pokemon.PokemonId);
if (transferPokemonResponse.Status == 1)
{
ColoredConsoleWrite(Color.Green, $"Pokemon {pokemon.PokemonId} with {pokemon.Cp} CP and IV at {Perfect(pokemon)}% is transfered");
nbPokemons--;
}
else
{
var status = transferPokemonResponse.Status;
ColoredConsoleWrite(Color.Red, $"Somehow failed to transfer {pokemonName} with {pokemon.Cp} CP. " +
$"ReleasePokemonOutProto.Status was {status}");
}
await Task.Delay(0); //3000
}
}
}
示例6: TransferAllGivenPokemons
private async Task TransferAllGivenPokemons(Client client, IEnumerable<PokemonData> unwantedPokemons, float keepPerfectPokemonLimit = 80.0f)
{
foreach (var pokemon in unwantedPokemons)
{
if (Perfect(pokemon) >= keepPerfectPokemonLimit) continue;
ColoredConsoleWrite(Color.White, string.Format(Properties.Strings.IV_less, pokemon.PokemonId, pokemon.Cp, keepPerfectPokemonLimit));
if (pokemon.Favorite == 0)
{
var transferPokemonResponse = await client.TransferPokemon(pokemon.Id);
/*
ReleasePokemonOutProto.Status {
UNSET = 0;
SUCCESS = 1;
POKEMON_DEPLOYED = 2;
FAILED = 3;
ERROR_POKEMON_IS_EGG = 4;
}*/
string pokemonName;
if (ClientSettings.Language == "de")
{
// Dont really need to print this do we? youll know if its German or not
//ColoredConsoleWrite(Color.DarkCyan, "german");
string name_english = Convert.ToString(pokemon.PokemonId);
var request = (HttpWebRequest)WebRequest.Create("http://boosting-service.de/pokemon/index.php?pokeName=" + name_english);
var response = (HttpWebResponse)request.GetResponse();
pokemonName = new StreamReader(response.GetResponseStream()).ReadToEnd();
}
else
pokemonName = Convert.ToString(pokemon.PokemonId);
if (transferPokemonResponse.Status == 1)
{
ColoredConsoleWrite(Color.Magenta, string.Format(Properties.Strings.transfer, pokemonName, pokemon.Cp));
}
else
{
var status = transferPokemonResponse.Status;
ColoredConsoleWrite(Color.Red, string.Format(Properties.Strings.transfer_failed, pokemonName, pokemon.Cp, status));
}
await Task.Delay(3000);
}
}
}
示例7: TransferAllGivenPokemons
private static async Task TransferAllGivenPokemons(Client client, IEnumerable<PokemonData> unwantedPokemons)
{
foreach (var pokemon in unwantedPokemons)
{
var transferPokemonResponse = await client.TransferPokemon(pokemon.Id);
if (transferPokemonResponse.Status == 1)
{
Console.ForegroundColor = ConsoleColor.DarkCyan;
Console.WriteLine($"Shoved another {pokemon.PokemonId} ({pokemon.Cp}CP) down the meat grinder");
Console.ForegroundColor = ConsoleColor.White;
}
else
{
var status = transferPokemonResponse.Status;
Console.WriteLine($"Somehow failed to grind {pokemon.PokemonId}. " +
$"ReleasePokemonOutProto.Status was {status}");
}
await Task.Delay(3000);
}
}