Progressing with the implementation

This commit is contained in:
King_DuckZ 2014-12-12 20:04:48 +01:00
parent 9086de8dae
commit 0da607ab3d
14 changed files with 192 additions and 59 deletions

10
src/doorkeeperConfig.h.in Normal file
View file

@ -0,0 +1,10 @@
#ifndef idFEDC74BA6A4345AD8D76106228CB2E89
#define idFEDC74BA6A4345AD8D76106228CB2E89
#if !defined(NDEBUG)
# define DATA_PATH "@CMAKE_SOURCE_DIR@"
#else
# define DATA_PATH ""
#endif
#endif

View file

@ -1,16 +1,27 @@
#include "doorkeeper.hpp"
#include "doorkeeperConfig.h"
#include <iostream>
#include <fstream>
#include <memory>
#include "doorkeeper.hpp"
int main() {
typedef dk::Tyler<2> Tiler;
typedef std::unique_ptr<std::ifstream> ifstreamptr;
Tiler tiler(Tiler::coords(200, 150), Tiler::coords(64));
Tiler tiler(Tiler::coords(8, 6), Tiler::coords(64));
tiler.push_layer<int>(dk::Layer<int, 2>::streamer_type(ifstreamptr(new std::ifstream("test.map"))));
tiler.push_layer<char>(dk::Layer<char, 2>::streamer_type(ifstreamptr(new std::ifstream("test_2.map"))));
auto bottom_layer = &tiler.push_layer<int>(dk::Layer<int, 2>::streamer_type(ifstreamptr(new std::ifstream(DATA_PATH"test.map"))));
tiler.push_layer<char>(dk::Layer<char, 2>::streamer_type(ifstreamptr(new std::ifstream(DATA_PATH"test_2.map"))));
{
auto ittest = bottom_layer->begin();
for (int z = 0; z < 10; ++z) {
#if !defined(NDEBUG)
std::cout << "At tile " << ittest.position() << " value " << *ittest << '\n';
#endif
++ittest;
}
}
#if !defined(NDEBUG)
std::cout << "Map size: " << tiler.map_size() << '\n';