YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
DrawableWorldObjectOrderComparator.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Graphics/Game/World/Map/DrawableWorldObjectOrderComparator.hpp
"
2
#include "
YAPOG/Graphics/Game/World/Map/IDrawableWorldObject.hpp
"
3
4
namespace
yap
5
{
6
DrawableWorldObjectOrderComparator::DrawableWorldObjectOrderComparator
()
7
:
LessComparator
<
IDrawableWorldObject
*> ()
8
{
9
}
10
11
DrawableWorldObjectOrderComparator::~DrawableWorldObjectOrderComparator
()
12
{
13
}
14
15
DrawableWorldObjectOrderComparator::DrawableWorldObjectOrderComparator
(
16
const
DrawableWorldObjectOrderComparator
& copy)
17
:
LessComparator
<
IDrawableWorldObject
*> (copy)
18
{
19
}
20
21
DrawableWorldObjectOrderComparator
&
22
DrawableWorldObjectOrderComparator::operator=
(
23
const
DrawableWorldObjectOrderComparator
& copy)
24
{
25
if
(
this
== ©)
26
return
*
this
;
27
28
LessComparator<IDrawableWorldObject*>::operator=
(copy);
29
30
return
*
this
;
31
}
32
33
int
DrawableWorldObjectOrderComparator::HandleCompare
(
34
IDrawableWorldObject
*
const
& left,
35
IDrawableWorldObject
*
const
& right)
const
36
{
37
if
(left->
GetLayerDepth
() < right->
GetLayerDepth
())
38
return
-1;
39
40
if
(left->
GetLayerDepth
() > right->
GetLayerDepth
())
41
return
1;
42
43
return
left->
GetComparisonPoint
() - right->
GetComparisonPoint
();
44
}
45
}
// namespace yap
YAPOG
src
YAPOG
Graphics
Game
World
Map
DrawableWorldObjectOrderComparator.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1