editor map context implements display_context interface

This commit is contained in:
Chris Beck 2014-06-10 14:51:16 -04:00
parent d9b3289355
commit 90e5d9206b

View File

@ -22,6 +22,7 @@
#include "tod_manager.hpp"
#include "unit_map.hpp"
#include "overlay.hpp"
#include "../../display_context.hpp"
#include <boost/utility.hpp>
#include <boost/scoped_ptr.hpp>
@ -35,7 +36,7 @@ namespace editor {
* as e.g. the undo stack is part of the map, not the editor as a whole. This might allow many
* maps to be open at the same time.
*/
class map_context : private boost::noncopyable
class map_context : public display_context, private boost::noncopyable
{
public:
/**
@ -58,7 +59,7 @@ public:
/**
* Map context destructor
*/
~map_context();
virtual ~map_context();
/**
* Select the nth tod area.
@ -122,6 +123,19 @@ public:
void replace_schedule(const std::vector<time_of_day>& schedule);
/**
* Const accessor names needed to implement "display_context" interface
*/
virtual const unit_map & units() const {
return units_;
}
virtual const std::vector<team>& teams() const {
return teams_;
}
virtual const gamemap & map() const {
return map_;
}
/**
* Replace the [time]s of the currently active area.
*/