/* 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 . */ #ifndef idD358B9737CC045D3B35F2B5C2FCF84FA #define idD358B9737CC045D3B35F2B5C2FCF84FA #include "doorkeeper/components/viewport.hpp" #include namespace dk { template class LayerBase; template class IterableViewport { public: typedef typename Viewport::coords coords; IterableViewport ( const Viewport* parViewport, const LayerBase* parLayerBase ) : m_viewport(parViewport), m_layer(parLayerBase) { DK_ASSERT(m_viewport); DK_ASSERT(m_layer); } void each_tile ( void ) const { m_layer->each_tile(*m_viewport); } coords size ( void ) const { return m_viewport->size(); } private: const Viewport* const m_viewport; const LayerBase* const m_layer; }; } //namespace dk #endif