YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
GridCollidableArea.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_GRIDCOLLIDABLEAREA_HPP
2
# define YAPOG_GRIDCOLLIDABLEAREA_HPP
3
4
# include "
YAPOG/Macros.hpp
"
5
# include "
YAPOG/Game/World/Map/Physics/CollidableArea.hpp
"
6
# include "
YAPOG/Collection/Matrix.hpp
"
7
# include "
YAPOG/Graphics/Vector2.hpp
"
8
9
namespace
yap
10
{
11
class
CollidableAreaCell;
12
13
class
YAPOG_LIB
GridCollidableArea
:
public
CollidableArea
14
{
15
DISALLOW_COPY
(
GridCollidableArea
);
16
17
public
:
18
19
GridCollidableArea
();
20
virtual
~
GridCollidableArea
();
21
22
void
SetSegmentCount (
uint
vSegmentCount,
uint
hSegmentCount);
23
24
virtual
bool
CollidesWith (
25
const
ICollidable
& collidable,
26
const
Vector2
& offset,
27
const
WorldObject
& parent)
const
;
28
29
virtual
void
GetEventsCollidingWith (
30
const
ICollidable
& collidable,
31
MapEventQueue
& events,
32
DynamicWorldObject
& parent)
const
;
33
34
protected
:
35
36
virtual
void
HandleSetSize (
const
Vector2
& size);
37
38
virtual
void
HandleAddPhysicsCollidable (
39
ICollidable
* collidable,
40
const
MapCollidableInfo::PtrType
& mapCollidableInfo);
41
virtual
void
HandleRemovePhysicsCollidable (
ICollidable
* collidable);
42
43
virtual
void
HandleAddEventCollidable (
44
ICollidable
* collidable,
45
const
MapEventInfo::PtrType
& mapEventInfo);
46
virtual
void
HandleRemoveEventCollidable (
ICollidable
* collidable);
47
48
private
:
49
50
void
GetCollidableRectangle (
51
const
ICollidable
& collidable,
52
UIntRect
& rectangle)
const
;
53
void
GetCollidableRectangle (
54
const
ICollidable
& collidable,
55
const
Vector2
& offset,
56
UIntRect
& rectangle)
const
;
57
58
static
const
uint
MIN_VSEGMENT_COUNT
;
59
static
const
uint
MIN_HSEGMENT_COUNT
;
60
61
uint
vSegmentCount_
;
62
uint
hSegmentCount_
;
63
64
Vector2
cellSize_
;
65
66
collection::Matrix<CollidableAreaCell*>
cells_
;
67
};
68
}
// namespace yap
69
70
#endif // YAPOG_GRIDCOLLIDABLEAREA_HPP
YAPOG
include
YAPOG
Game
World
Map
Physics
GridCollidableArea.hpp
Generated on Mon Sep 17 2012 22:24:23 for YAPOG by
1.8.1.1