Skip to content

File MessageBoard.hpp

File List > Interfaces > MessageBoard.hpp

Go to the documentation of this file



#pragma once

#include <SFML/Graphics.hpp>
#include <iostream>
#include <sstream>
#include <memory>
#include <chrono>

namespace i_2D {

    class MessageBoard {

    private:
        std::unique_ptr<sf::Text> mText;
        std::chrono::time_point<std::chrono::system_clock> mStartTime;

    public:
        explicit MessageBoard(sf::Font &font);

        void DrawTo(sf::RenderWindow &window);

        void Send(const std::string &message) {
            mText->setString(message);
            mStartTime = std::chrono::system_clock::now();
        }
    };
}