本文整理汇总了C#中PokemonData类的典型用法代码示例。如果您正苦于以下问题:C# PokemonData类的具体用法?C# PokemonData怎么用?C# PokemonData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PokemonData类属于命名空间,在下文中一共展示了PokemonData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Client
public Client(ClientIdentifier id)
{
Id = id;
var stats = new Stats { Atk = 10, Def = 10, HP = 30, SpAtk = 10, SpDef = 10, Speed = 10 };
var data = new PokemonData { Id = 0, Type1 = PokemonType.Normal, BaseStats = stats };
var moveData = new MoveData
{
Name = "Move",
Accuracy = 100,
Damage = 120,
DamageType = DamageCategory.Physical,
PokemonType = PokemonType.Normal,
PP = 20
};
for (int i = 0; i < 6; i++)
{
var pkmn = new Pokemon(data, stats) { Name = Id.Name + "_Pkmn" + i, Level = i + 20};
for (int j = 0; j < 2; j++)
pkmn.SetMove(j, new Move(moveData));
pkmn.Stats.HP = 30;
pkmn.HP = 30;
pokemons.Add(pkmn);
}
}
示例2: CalculateCpMultiplier
public static double CalculateCpMultiplier(PokemonData poke)
{
var baseStats = GetBaseStats(poke.PokemonId);
return (baseStats.BaseAttack + poke.IndividualAttack)*
Math.Sqrt(baseStats.BaseDefense + poke.IndividualDefense)*
Math.Sqrt(baseStats.BaseStamina + poke.IndividualStamina);
}
示例3: CalculatePokemonPerfection
public static float CalculatePokemonPerfection(PokemonData poke)
{
if (poke != null)
return (poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0f * 15.0f) * 100.0f;
else
return 0;
}
示例4: PokemonCaught
public static async Task PokemonCaught(PokemonData poke)
{
OnPokemonCaught(null, new PokemonCaughtArgs() { CaughtPokemon = poke });
await PokemonCaughtReset.WaitAsync();
PokemonCaughtReset.Reset();
}
示例5: GetHighestCPofType
public async Task<int> GetHighestCPofType(PokemonData pokemon)
{
var myPokemon = await GetPokemons();
var pokemons = myPokemon.ToList();
return pokemons.Where(x => x.PokemonId == pokemon.PokemonId)
.OrderByDescending(x => x.Cp)
.First().Cp;
}
示例6: CalculateMinCp
public static int CalculateMinCp(PokemonData poke)
{
return
Math.Max(
(int)
Math.Floor(0.1*CalculateMinCpMultiplier(poke)*
Math.Pow(poke.CpMultiplier + poke.AdditionalCpMultiplier, 2)), 10);
}
示例7: GetHighestIVofType
public async Task<IEnumerable<PokemonData>> GetHighestIVofType(PokemonData pokemon)
{
var myPokemon = await GetPokemons();
var pokemons = myPokemon.ToList();
return pokemons.Where(x => x.PokemonId == pokemon.PokemonId)
.OrderByDescending(PokemonInfo.CalculatePokemonPerfection)
.ThenBy(x => x.Cp)
.ToList();
}
示例8: CalculatePokemonPerfection
public static double CalculatePokemonPerfection(PokemonData poke)
{
if (Math.Abs(poke.CpMultiplier + poke.AdditionalCpMultiplier) <= 0)
return (poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0 * 15.0) * 100.0;
var maxCp = CalculateMaxCpMultiplier(poke);
var minCp = CalculateMinCpMultiplier(poke);
var curCp = CalculateCpMultiplier(poke);
return ((curCp - minCp) / (maxCp - minCp)) * 100.0;
}
示例9: CalculatePokemonPerfection
public static double CalculatePokemonPerfection(PokemonData poke)
{
if (poke.CpMultiplier + poke.AdditionalCpMultiplier == 0)
return (poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0 * 15.0) * 100.0;
BaseStats baseStats = GetBaseStats(poke.PokemonId);
var max_cp = CalculateMaxCPMultiplier(poke);
var min_cp = CalculateMinCPMultiplier(poke);
var cur_cp = CalculateCPMultiplier(poke);
return ((cur_cp - min_cp) / (max_cp - min_cp)) * 100.0;
}
示例10: Transfer
public async Task<TransferStatus> Transfer(PokemonData pokemon, float keepPerfectPokemonLimit = 80.0f)
{
if (Perfect(pokemon) >= keepPerfectPokemonLimit || pokemon.Favorite == 0) return TransferStatus.Ignored;
var transferPokemonResponse = await PokemonClient.TransferPokemon(pokemon.Id);
await Task.Delay(3000);
if (transferPokemonResponse.Status == 1)
{
return TransferStatus.Success;
}
return TransferStatus.Fail;
}
示例11: HandleEvent
protected void HandleEvent(PokemonData pokemon, TransferStatus status)
{
if (status == TransferStatus.Success)
{
OnTransferSuccess(pokemon);
}
else if (status == TransferStatus.Fail)
{
OnTransferFailed(pokemon);
}
else if(status == TransferStatus.Ignored)
{
OnTransferIgnored(pokemon);
}
}
示例12: FromPokemonData
public Pokemon FromPokemonData(PokemonData data)
{
if (data == null)
return null;
//var iStats = GenerateIV();
// var stats = new Stats
// {
// HP = data.BaseStats.HP + iStats.HP,
// Atk = data.BaseStats.Atk + iStats.Atk,
// Def = data.BaseStats.Def + iStats.Def,
// SpAtk = data.BaseStats.SpAtk + iStats.SpAtk,
// SpDef = data.BaseStats.SpDef + iStats.SpDef,
// Speed = data.BaseStats.Speed + iStats.Speed
// };
//var builder = new PokemonBuilder(data);
//builder.SetIV (iStats).SetStats (stats);
//return builder.Build ();
throw new NotImplementedException();
}
示例13: GetHighestPokemonOfTypeByCp
public async Task<PokemonData> GetHighestPokemonOfTypeByCp(PokemonData pokemon)
{
var myPokemon = await GetPokemons();
var pokemons = myPokemon.ToList();
return pokemons.Where(x => x.PokemonId == pokemon.PokemonId)
.OrderByDescending(x => x.Cp)
.FirstOrDefault();
}
示例14: GetPokemonMove2
public static PokemonMove GetPokemonMove2(PokemonData poke)
{
var move2 = poke.Move2;
return move2;
}
示例15: GetPowerUpLevel
public static int GetPowerUpLevel(PokemonData poke)
{
return (int) (GetLevel(poke)*2.0);
}