Some changes and the build is fine again.
This is a test version, design is still in progress.
This commit is contained in:
parent
f9e249a972
commit
e63aebe6e1
15 changed files with 252 additions and 19 deletions
|
@ -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
26
src/test/test_tiler.cpp
Normal 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
19
src/test/test_tiler.hpp
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue