2015-08-19 19:06:58 +00:00
|
|
|
/* Copyright 2015, Michele Santullo
|
|
|
|
* This file is part of DoorKeeper.
|
|
|
|
*
|
|
|
|
* DoorKeeper is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* DoorKeeper is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with DoorKeeper. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-12-09 21:30:06 +00:00
|
|
|
namespace dk {
|
2014-12-09 22:53:09 +00:00
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
2015-01-08 11:20:17 +00:00
|
|
|
template <uint32_t D>
|
2015-08-26 16:08:05 +00:00
|
|
|
Tyler<D>::Tyler() {
|
2014-12-09 22:53:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
2015-01-08 11:20:17 +00:00
|
|
|
template <uint32_t D>
|
2014-12-09 22:53:09 +00:00
|
|
|
template <typename T>
|
2015-06-07 01:57:18 +00:00
|
|
|
Layer<T, D>& Tyler<D>::push_layer (BaseMapSource<D>* parTilemap, int parIndex) {
|
|
|
|
//TODO: store the index
|
|
|
|
(void)parIndex;
|
|
|
|
|
2015-08-26 16:08:05 +00:00
|
|
|
auto newLayer = new Layer<T, D>(parTilemap);
|
2014-12-12 19:04:48 +00:00
|
|
|
m_layers.push_back(LayerPtr(newLayer));
|
|
|
|
return *newLayer;
|
2014-12-09 22:53:09 +00:00
|
|
|
}
|
2014-12-14 12:13:10 +00:00
|
|
|
|
2015-06-07 01:57:18 +00:00
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
template <uint32_t D>
|
|
|
|
template <typename T>
|
|
|
|
void Tyler<D>::push_layer_void (BaseMapSource<D>* parTilemap, int parIndex) {
|
|
|
|
push_layer<T>(parTilemap, parIndex);
|
|
|
|
}
|
|
|
|
|
2014-12-14 12:13:10 +00:00
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
2015-01-08 11:20:17 +00:00
|
|
|
template <uint32_t D>
|
2014-12-14 12:13:10 +00:00
|
|
|
void Tyler<D>::preload (const coords& parFrom, const coords& parTo) {
|
|
|
|
for (auto& layer : m_layers) {
|
|
|
|
layer->preload(parFrom, parTo);
|
|
|
|
}
|
|
|
|
}
|
2015-08-27 15:12:55 +00:00
|
|
|
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
template <uint32_t D>
|
|
|
|
auto Tyler<D>::begin() -> iterator {
|
|
|
|
return iterator(m_layers.begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
template <uint32_t D>
|
|
|
|
auto Tyler<D>::begin() const -> const_iterator {
|
|
|
|
return const_iterator(m_layers.begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
template <uint32_t D>
|
|
|
|
auto Tyler<D>::end() -> iterator {
|
|
|
|
return iterator(m_layers.end());
|
|
|
|
}
|
|
|
|
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
///--------------------------------------------------------------------------
|
|
|
|
template <uint32_t D>
|
|
|
|
auto Tyler<D>::end() const -> const_iterator {
|
|
|
|
return const_iterator(m_layers.end());
|
|
|
|
}
|
2014-12-09 21:30:06 +00:00
|
|
|
} //namespace dk
|