YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PokemonMoveTable.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Game/Pokemon/PokemonMove.hpp
"
2
3
#include "
Database/Tables/PokemonMoveTable.hpp
"
4
#include "Pokemon/Pokemon.hpp"
5
6
namespace
yse
7
{
8
const
yap::ID
PokemonMoveTable::DEFAULT_STATIC_ID
(0);
9
const
yap::UInt16
PokemonMoveTable::DEFAULT_PP
= 0;
10
const
yap::UInt16
PokemonMoveTable::DEFAULT_MAX_PP
= 0;
11
12
PokemonMoveTable::PokemonMoveTable
()
13
: pokemonID_ (1)
14
{
15
}
16
17
void
PokemonMoveTable::LoadFromPokemon
(
18
const
Pokemon
& pokemon,
19
const
yap::ID
& index)
20
{
21
pokemonID_
= pokemon.
GetUniqueID
();
22
index_
= index;
23
24
yap::collection::Array<yap::PokemonMove*>
moves =
25
pokemon.
GetMoveSet
().
GetMoves
();
26
27
if
(moves[index.
GetValue
()] ==
nullptr
)
28
{
29
staticID_
=
DEFAULT_STATIC_ID
;
30
pp_
=
DEFAULT_PP
;
31
maxPP_
=
DEFAULT_MAX_PP
;
32
}
33
else
34
{
35
staticID_
= moves[index.
GetValue
()]->GetStaticID ();
36
pp_
= moves[index.
GetValue
()]->GetCurrentPP ();
37
maxPP_
= moves[index.
GetValue
()]->GetMaxPP ();
38
}
39
}
40
41
}
// namespace yse
YAPOG.Server
src
Database
Tables
PokemonMoveTable.cpp
Generated on Mon Sep 17 2012 22:24:22 for YAPOG by
1.8.1.1