#include <memory>
#include <msp/time/timedelta.h>
#include "handle.h"
-#include "root.h"
namespace Msp::Game {
+class Root;
class System;
class Stage
{
private:
PoolPool pools;
- Root root;
+ /* Use unique_ptr because there's only one root per stage so it's pointless
+ to put it in a pool. */
+ std::unique_ptr<Root> root;
std::vector<std::unique_ptr<System>> systems;
public:
~Stage();
PoolPool &get_pools() { return pools; }
- Handle<Root> get_root() { return Handle<Root>::from_object(&root); }
+ Handle<Root> get_root() { return Handle<Root>::from_object(root.get()); }
template<typename T, typename F>
void iterate_objects(const F &);