/*
** EPITECH PROJECT, 2019
** GGJ_2019
** File description:
** data.cpp
*/

#include <iostream>
#include "panel.hpp"
#include "data.hpp"

Data::Data(void)
    :m_window(sf::VideoMode(1920, 1080), "murphySim")
{
    if (!m_font.loadFromFile("fonts/OpenDyslexic-Regular.ttf"))
	std::cerr << "Couldn't load font file\n";
    if (!m_music.openFromFile("sounds/All_of_me.ogg"))
	std::cerr << "Couldn't load music file\n";
}

void Data::load_panel(GamePanel& panel)
{
    m_panel = &panel;    
}

void Data::display(void)
{
    m_window.display();
}

void Data::get_input(void)
{
    sf::Event event;
    
    while (m_window.pollEvent(event)) {
        if (event.type == sf::Event::Closed)
	    m_window.close();
    }
}

sf::RenderWindow& Data::get_window(void)
{
    return (m_window);
}

sf::Font Data::get_font(void)
{
    return (m_font);
}
