YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
World.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_CLIENT_WORLD_HPP
2
# define YAPOG_CLIENT_WORLD_HPP
3
4
# include "
YAPOG/Macros.hpp
"
5
# include "
YAPOG/Game/World/World.hpp
"
6
# include "
YAPOG/Graphics/IDrawable.hpp
"
7
# include "
YAPOG/Collection/Map.hpp
"
8
# include "
YAPOG/Game/ID.hpp
"
9
# include "
YAPOG/System/Event/Event.hpp
"
10
# include "
YAPOG/System/Network/IPacketHandler.hpp
"
11
# include "
YAPOG/System/Network/PacketHandler.hpp
"
12
13
namespace
yap
14
{
15
struct
IWorldDrawingPolicy;
16
}
// namespace yap
17
18
namespace
ycl
19
{
20
class
Map;
21
22
class
World
:
public
yap::World
23
,
public
yap::IDrawable
24
,
public
yap::IPacketHandler
25
{
26
DISALLOW_COPY
(
World
);
27
28
public
:
29
30
World
();
31
virtual
~World
();
32
33
void
AddMap
(
const
yap::ID
& worldID,
const
yap::ID
&
id
);
34
35
void
ChangeMap
(
const
yap::ID
& worldID);
36
Map
&
GetCurrentMap
();
37
38
void
SetDrawingPolicy
(
const
yap::IWorldDrawingPolicy
& drawingPolicy);
39
42
virtual
void
Draw
(
yap::IDrawingContext
& context);
43
44
virtual
bool
IsVisible
()
const
;
45
virtual
void
Show
(
bool
isVisible);
46
47
virtual
void
ChangeColor
(
const
sf::Color& color);
49
52
virtual
bool
HandlePacket
(
yap::IPacket
& packet);
53
virtual
bool
SendPacket
(
yap::IPacket
& packet);
54
55
virtual
void
AddRelay
(
yap::IPacketHandler
* relay);
56
virtual
void
RemoveRelay
(
yap::IPacketHandler
* relay);
57
virtual
void
SetParent
(
yap::IPacketHandler
* parent);
59
62
yap::Event<const World&, const yap::ChangeEventArgs<Map*>
&>
OnMapChanged
;
64
65
virtual
void
HandleUpdate
(
const
yap::Time
& dt);
66
67
virtual
void
HandleDraw
(
yap::IDrawingContext
& context);
68
69
virtual
void
HandleShow
(
bool
isVisible);
70
virtual
void
HandleChangeColor
(
const
sf::Color& color);
71
72
private
:
73
74
void
AddMap
(
Map
* map);
75
void
RemoveMap
(
const
yap::ID
& worldID);
76
77
static
const
bool
DEFAULT_VISIBLE_STATE
;
78
static
const
sf::Color
DEFAULT_COLOR
;
79
80
bool
isVisible_
;
81
sf::Color
color_
;
82
83
const
yap::IWorldDrawingPolicy
*
drawingPolicy_
;
84
85
yap::ID
currentMapID_
;
86
Map
*
currentMap_
;
87
yap::collection::Map<yap::ID, Map*>
maps_
;
88
89
yap::PacketHandler
packetHandler_
;
90
};
91
}
// namespace ycl
92
93
#endif // YAPOG_CLIENT_WORLD_HPP
YAPOG.Client
include
World
World.hpp
Generated on Mon Sep 17 2012 22:24:23 for YAPOG by
1.8.1.1