YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Tile.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_TILE_HPP
2
# define YAPOG_TILE_HPP
3
4
# include <SFML/Graphics/Color.hpp>
5
6
# include "
YAPOG/Macros.hpp
"
7
# include "
YAPOG/System/IntTypes.hpp
"
8
# include "
YAPOG/Graphics/ISpatial.hpp
"
9
# include "
YAPOG/Graphics/IDrawable.hpp
"
10
# include "
YAPOG/Game/IUpdateable.hpp
"
11
# include "
YAPOG/Game/Factory/IIDLoadable.hpp
"
12
# include "
YAPOG/Game/ID.hpp
"
13
# include "
YAPOG/Graphics/SpatialInfo.hpp
"
14
15
namespace
yap
16
{
17
struct
ISprite;
18
19
class
TileFamily;
20
21
class
YAPOG_LIB
Tile
:
public
ISpatial
22
,
public
IDrawable
23
,
public
IUpdateable
24
,
public
IIDLoadable
25
{
26
DISALLOW_ASSIGN
(
Tile
);
27
28
public
:
29
30
static
const
UInt32
DEFAULT_SIZE
;
31
32
Tile
(
const
ID
&
id
);
33
virtual
~
Tile
();
34
35
const
ID
& GetID ()
const
;
36
void
SetID (
const
ID
&
id
);
37
38
void
SetSprite (
ISprite
* sprite);
39
40
void
SetFamily (
const
TileFamily
* family);
41
bool
BelongsTo (
const
TileFamily
& family)
const
;
42
45
virtual
const
Vector2
& GetPosition ()
const
;
46
virtual
const
Vector2
& GetSize ()
const
;
47
48
virtual
const
Vector2
& GetTopLeft ()
const
;
49
virtual
const
Vector2
& GetBottomRight ()
const
;
50
virtual
const
Vector2
& GetCenter ()
const
;
51
52
virtual
const
sf::FloatRect
& GetRectangle ()
const
;
53
54
virtual
void
Move (
const
Vector2
& offset);
55
virtual
void
Scale (
const
Vector2
& factor);
56
57
virtual
void
SetPosition (
const
Vector2
& position);
58
virtual
void
SetSize (
const
Vector2
& size);
60
63
virtual
void
Draw (
IDrawingContext
& context);
64
65
virtual
bool
IsVisible ()
const
;
66
virtual
void
Show (
bool
isVisible);
67
68
virtual
void
ChangeColor (
const
sf::Color& color);
70
73
virtual
void
Update (
const
Time
& dt);
75
78
virtual
Tile
* Clone ()
const
;
80
81
protected
:
82
83
Tile
(
const
Tile
& copy);
84
85
private
:
86
87
static
const
bool
DEFAULT_VISIBLE_STATE
;
88
static
const
sf::Color
DEFAULT_COLOR
;
89
90
ID
id_
;
91
92
ISprite
*
sprite_
;
93
const
TileFamily
*
family_
;
94
95
SpatialInfo
spatialInfo_
;
96
bool
isVisible_
;
97
sf::Color
color_
;
98
};
99
}
// namespace yap
100
101
#endif // YAPOG_TILE_HPP
YAPOG
include
YAPOG
Graphics
Game
World
Map
Tile.hpp
Generated on Mon Sep 17 2012 22:24:23 for YAPOG by
1.8.1.1