YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
BasicTileLayoutHandler.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Graphics/Game/World/Map/BasicTileLayoutHandler.hpp
"
2
#include "
YAPOG/Graphics/Game/World/Map/TileLayer.hpp
"
3
4
namespace
yap
5
{
6
BasicTileLayoutHandler::BasicTileLayoutHandler
(
uint
width,
uint
height)
7
:
TileLayoutHandler
()
8
, width_ (width)
9
, height_ (height)
10
, tiles_ (width_ * height_, nullptr)
11
{
12
}
13
14
BasicTileLayoutHandler::~BasicTileLayoutHandler
()
15
{
16
}
17
18
void
BasicTileLayoutHandler::SetTile
(
uint
x,
uint
y,
Tile
* tile)
19
{
20
tiles_
[y *
width_
+ x] = tile;
21
}
22
23
void
BasicTileLayoutHandler::HandleExecute
(
TileLayer
& tileLayer)
24
{
25
for
(
uint
y = 0; y <
height_
; ++y)
26
for
(
uint
x = 0; x <
width_
; ++x)
27
tileLayer.
SetTile
(x, y,
tiles_
[y * width_ + x]);
28
}
29
}
// namespace yap
YAPOG
src
YAPOG
Graphics
Game
World
Map
BasicTileLayoutHandler.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1