#pragma once

#include <frostbite2D/base/RefObject.h>
#include <frostbite2D/types/type_alias.h>
#include <frostbite2D/utils/intrusive_list.hpp>
#include <frostbite2D/2d/actor.h>
#include <vector>

namespace frostbite2D {

using ActorList = IntrusiveList<RefPtr<Actor>>;

class Scene : public RefObject {
public:
  Scene();
  virtual ~Scene();

  virtual void onEnter();
  virtual void onExit();

  void Update(float deltaTime);
  void Render();

  void AddActor(RefPtr<Actor> actor);
  void RemoveActor(RefPtr<Actor> actor);
  void RemoveAllActors();

protected:
  void UpdateActors(float deltaTime);
  void RenderActors();

private:
  ActorList actors_;

  friend class Actor;
  friend class SceneManager;
};

}

