YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Pokedex.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Game/Pokemon/Pokedex.hpp
"
2
3
namespace
yap
4
{
5
Pokedex::Pokedex
()
6
: pokCaught_ ()
7
, pokList_ ()
8
, pokSeen_ ()
9
{
10
11
}
12
13
Pokedex::~Pokedex
()
14
{
15
16
}
17
18
uint
Pokedex::GetPokemonSeenCount
()
const
19
{
20
return
pokSeen_
.
Count
();
21
}
22
uint
Pokedex::GetPokemonCaughtCount
()
const
23
{
24
return
pokCaught_
.
Count
();
25
}
26
uint
Pokedex::GetPokemonCount
()
const
27
{
28
return
pokList_
.
Count
();
29
}
30
31
uint
Pokedex::GetMaxIDSeen
()
const
32
{
33
ID
maxID (0);
34
for
(
PokemonInfo
* pok :
pokSeen_
)
35
{
36
if
(pok->GetID () > maxID)
37
maxID = pok->GetID ();
38
}
39
40
return
maxID.
GetValue
();
41
}
42
const
PokemonInfo
&
Pokedex::GetPokemonSeen
(
uint
index)
const
43
{
44
return
*
pokSeen_
[index];
45
}
46
47
PokemonInfo
*
Pokedex::GetPokemon
(
uint
index)
const
48
{
49
if
(index <
pokList_
.
Count
())
50
return
pokList_
[index];
51
else
52
{
53
return
nullptr
;
54
}
55
}
56
const
PokemonInfo
*
Pokedex::GetPokemonSeenID
(
uint
ID
)
const
57
{
58
for
(
PokemonInfo
* pok :
pokSeen_
)
59
{
60
if
(pok->GetID ().GetValue () == ID)
61
return
pok;
62
}
63
return
nullptr
;
64
}
65
66
void
Pokedex::AddPokemon
(
PokemonInfo
* pok)
67
{
68
OnAddPokemon
(*
this
,
yap::EmptyEventArgs
());
69
pokList_
.
Add
(pok);
70
}
71
72
void
Pokedex::AddPokemonSeen
(
PokemonInfo
* pokSeen)
73
{
74
OnAddPokemon
(*
this
,
yap::EmptyEventArgs
());
75
pokSeen_
.
Add
(pokSeen);
76
}
77
78
void
Pokedex::AddPokemonCaught
(
PokemonInfo
* pokCaught)
79
{
80
OnAddPokemon
(*
this
,
yap::EmptyEventArgs
());
81
pokCaught_
.
Add
(pokCaught);
82
}
83
84
void
Pokedex::SetPokemonSeenInfoList
(
const
collection::Array<PokemonInfo*>
& pokSeen)
85
{
86
pokSeen_
= pokSeen;
87
}
88
89
void
Pokedex::SetPokemonCaughtInfoList
(
const
collection::Array<PokemonInfo*>
& pokCaught)
90
{
91
pokCaught_
= pokCaught;
92
}
93
94
void
Pokedex::SetPokemonList
(
const
collection::Array<PokemonInfo*>
& pokList)
95
{
96
pokList_
= pokList;
97
}
98
99
void
Pokedex::Init
()
100
{
101
102
}
103
}
YAPOG
src
YAPOG
Game
Pokemon
Pokedex.cpp
Generated on Mon Sep 17 2012 22:24:24 for YAPOG by
1.8.1.1