#include "scene/GameDebugUIScene.h"
#include "character/CharacterObject.h"
#include "common/debug/GameDebugActor.h"
#include "map/GameMap.h"

namespace frostbite2D {

void GameDebugUIScene::onEnter() {
  UIScene::onEnter();
  GameDebugActor::get().AttachToScene(this);
}

void GameDebugUIScene::onExit() {
  GameDebugActor::get().ClearDebugContext();
  GameDebugActor::get().DetachFromParent();
  UIScene::onExit();
}

void GameDebugUIScene::SetDebugContext(GameMap* map, CharacterObject* character) {
  GameDebugActor::get().SetDebugMap(map);
  GameDebugActor::get().SetTrackedCharacter(character);
}

void GameDebugUIScene::ClearDebugContext() {
  GameDebugActor::get().ClearDebugContext();
}

} // namespace frostbite2D
