2016-04-06 09:38:13 +00:00
|
|
|
#ifndef __PTF_MENU_HPP__
|
|
|
|
#define __PTF_MENU_HPP__
|
|
|
|
|
|
|
|
#include <SFML/Audio.hpp>
|
2016-04-06 16:16:39 +00:00
|
|
|
#include <iostream>
|
2016-04-06 09:38:13 +00:00
|
|
|
#include "manager.hpp"
|
2016-04-06 16:16:39 +00:00
|
|
|
#include "game.hpp"
|
|
|
|
#include "editor.hpp"
|
2016-04-06 09:38:13 +00:00
|
|
|
#include "view.hpp"
|
|
|
|
#include "resource_manager.hpp"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#define NB_CHOICES 4
|
|
|
|
|
|
|
|
/**
|
|
|
|
* La classe Menu charge le menu du jeu
|
|
|
|
* et permet de choisir entre jouer, lire les règles
|
|
|
|
* et quitter.
|
|
|
|
*/
|
|
|
|
class Menu : public View {
|
|
|
|
|
|
|
|
public:
|
|
|
|
Menu(Manager& manager);
|
|
|
|
virtual ~Menu();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dessine le menu
|
|
|
|
*/
|
|
|
|
void frame();
|
|
|
|
|
|
|
|
/**
|
2016-04-06 16:16:39 +00:00
|
|
|
* Permet de changer le choix sélectionné
|
2016-04-06 09:38:13 +00:00
|
|
|
*/
|
|
|
|
void MoveUp();
|
|
|
|
void MoveDown();
|
2016-04-07 20:03:08 +00:00
|
|
|
void menu1();
|
|
|
|
void menu2();
|
2016-04-06 09:38:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
//repère le choix sélectionné
|
|
|
|
int selection;
|
|
|
|
|
2016-04-07 20:03:08 +00:00
|
|
|
int menu_nb;
|
|
|
|
|
|
|
|
int positionY;
|
|
|
|
std::vector<std::function<void()>> menu[NB_CHOICES];
|
2016-04-06 09:38:13 +00:00
|
|
|
sf::Font font;
|
|
|
|
|
|
|
|
//tableau de textes modélisant les différents
|
|
|
|
//choix dans le menu
|
|
|
|
sf::Text choice[NB_CHOICES];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|