本文整理汇总了C++中Pokemon::GetBoxIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ Pokemon::GetBoxIndex方法的具体用法?C++ Pokemon::GetBoxIndex怎么用?C++ Pokemon::GetBoxIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pokemon
的用法示例。
在下文中一共展示了Pokemon::GetBoxIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendPokemonTeam
void User::SendPokemonTeam (PokemonTeam& pokemonTeam)
{
yap::Packet packet;
packet.CreateFromType (yap::PacketType::ServerInfoPokemonTeam);
// Send the number of Pokemon in the team
int pokemonNumber = pokemonTeam.GetPokemonCount ();
packet.Write (pokemonNumber);
Pokemon* currentPokemon = nullptr;
for (int i = 0; i < pokemonNumber; i++)
{
currentPokemon = &pokemonTeam.GetPokemon (i);
// Write the current pokemon basic information in the packet
packet.Write (currentPokemon->GetStaticID ());
packet.Write (currentPokemon->GetUniqueID ());
packet.Write (static_cast<yap::UInt8>(currentPokemon->GetGender ()));
packet.Write (static_cast<yap::UInt8>(currentPokemon->GetStatus ()));
packet.Write (currentPokemon->GetNickname ());
packet.Write (currentPokemon->GetShiny ());
packet.Write (currentPokemon->GetLoyalty ());
packet.Write (currentPokemon->GetNatureID ());
packet.Write (currentPokemon->GetTotalExperience ());
packet.Write (currentPokemon->GetBoxNumber ());
packet.Write (currentPokemon->GetBoxIndex ());
packet.Write (currentPokemon->GetCatchDate ());
packet.Write (currentPokemon->GetCurrentHP ());
// Write the current Pokemon's stats
const yap::PokemonStat& stats = currentPokemon->GetStats ();
// Send EV
packet.Write (stats.GetHitPoint ().GetEffortValue ());
packet.Write (stats.GetAttack ().GetEffortValue ());
packet.Write (stats.GetDefense ().GetEffortValue ());
packet.Write (stats.GetSpecialAttack ().GetEffortValue ());
packet.Write (stats.GetSpecialDefense ().GetEffortValue ());
packet.Write (stats.GetSpeed ().GetEffortValue ());
// Send IV
packet.Write (stats.GetHitPoint ().GetIndividualValue ());
packet.Write (stats.GetAttack ().GetIndividualValue ());
packet.Write (stats.GetDefense ().GetIndividualValue ());
packet.Write (stats.GetSpecialAttack ().GetIndividualValue ());
packet.Write (stats.GetSpecialDefense ().GetIndividualValue ());
packet.Write (stats.GetSpeed ().GetIndividualValue ());
// Send Pokemon's moves
const yap::PokemonMoveSet& moveSet =
currentPokemon->GetMoveSet ();
yap::UInt8 moveNumber = currentPokemon->GetMoveSet ().GetMoveNumber ();
// Send the move number of the Pokemon
packet.Write (moveNumber);
for (yap::UInt8 index = 0; index < 4; index++)
{
if (moveSet.GetMove (index) != nullptr)
{
packet.Write (moveSet.GetMove (index)->GetStaticID ());
packet.Write (index);
packet.Write (moveSet.GetMove (index)->GetCurrentPP ());
packet.Write (moveSet.GetMove (index)->GetMaxPP ());
}
}
}
SendPacket (packet);
}