Some changes and the build is fine again.

This is a test version, design is still in progress.
This commit is contained in:
King_DuckZ 2014-12-09 22:30:06 +01:00
parent f9e249a972
commit e63aebe6e1
15 changed files with 252 additions and 19 deletions

View file

@ -1,6 +1,9 @@
#include <iostream>
#include "doorkeeper.hpp"
#include "test/test_tiler.hpp"
int main() {
TestTiler simpleMap(TestTiler::coords(200, 150), "test.map");
std::cout << "Total tiles: " << simpleMap.tiles_count() << "\n";
return 0;
}

26
src/test/test_tiler.cpp Normal file
View file

@ -0,0 +1,26 @@
#include <iostream>
#include <fstream>
#include "test/test_tiler.hpp"
typedef dk::TileStreamer<int, 2> TileStreamerType;
///----------------------------------------------------------------------------
///----------------------------------------------------------------------------
TestTiler::TestTiler (const coords& parSize, const std::string&& parPath) :
parent_type(parSize, TileStreamerType(TileStreamerType::StreamPtr(new std::ifstream(parPath))))
{
}
///----------------------------------------------------------------------------
///----------------------------------------------------------------------------
bool TestTiler::batch_load (const std::vector<int>& parLoad) {
std::cout << "Would batch-load " << parLoad.size() << " elements\n";
return true;
}
///----------------------------------------------------------------------------
///----------------------------------------------------------------------------
bool TestTiler::single_load (const int&) {
std::cout << "Would load 1 element\n";
return true;
}

19
src/test/test_tiler.hpp Normal file
View file

@ -0,0 +1,19 @@
#ifndef idDD0A66B75FF546FCAF01C65E980DF224
#define idDD0A66B75FF546FCAF01C65E980DF224
#include "doorkeeper.hpp"
class TestTiler : public dk::Tyler<int, 2> {
typedef dk::Tyler<int, 2> parent_type;
public:
typedef parent_type::coords coords;
TestTiler ( const coords& parSize, const std::string&& parPath );
virtual ~TestTiler ( void ) noexcept = default;
virtual bool batch_load ( const std::vector<int>& parLoad );
virtual bool single_load ( const int& parLoad );
};
#endif