mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2024-11-15 11:33:24 +01:00
ddc6ff8bb3
bumped default memon save format to 0.1.0 updated json.hpp
30 lines
637 B
C++
30 lines
637 B
C++
//
|
|
// Created by Syméon on 02/03/2019.
|
|
//
|
|
|
|
#ifndef FEIS_NOTIFICATIONSQUEUE_H
|
|
#define FEIS_NOTIFICATIONSQUEUE_H
|
|
|
|
#include <deque>
|
|
#include <SFML/System.hpp>
|
|
#include "Notification.h"
|
|
|
|
class NotificationsQueue {
|
|
public:
|
|
explicit NotificationsQueue(int max_size = 10): max_size(max_size) {};
|
|
|
|
void push(const std::shared_ptr<Notification> ¬ification);
|
|
|
|
void display();
|
|
|
|
private:
|
|
void update();
|
|
float time_to_alpha(float seconds) {return std::max(0.0f,2.0f*(0.5f-seconds));}
|
|
sf::Clock last_push;
|
|
const int max_size;
|
|
std::deque<std::shared_ptr<Notification>> queue;
|
|
};
|
|
|
|
|
|
#endif //FEIS_NOTIFICATIONSQUEUE_H
|